diff --git a/src/main.js b/src/main.js
index 042cfedf..580a72bf 100644
--- a/src/main.js
+++ b/src/main.js
@@ -21,6 +21,7 @@ import auth from './directives/auth'
const app = createApp(App);
+//挂载全局对象
app.config.globalProperties.$CONFIG = config;
app.config.globalProperties.$TOOL = tool;
app.config.globalProperties.$HTTP = http;
@@ -31,6 +32,7 @@ app.use(store);
app.use(router);
app.use(ElementPlus, {size: 'small', locale: locale});
+//注册全局组件
app.component('scTable', scTable);
app.component('scFilterBar', scFilterBar);
app.component('scUpload', scUpload);
@@ -38,6 +40,8 @@ app.component('scUploadMultiple', scUploadMultiple);
app.component('scFormTable', scFormTable);
app.component('scTableSelect', scTableSelect);
+//注册全局指令
app.directive('auth', auth)
+//挂载app
app.mount('#app');
diff --git a/src/utils/tool.js b/src/utils/tool.js
index 03526678..72fb9ede 100644
--- a/src/utils/tool.js
+++ b/src/utils/tool.js
@@ -71,6 +71,16 @@ const tool = {
}
}
return fmt;
+ },
+ /* 千分符 */
+ thousands(num){
+ num = num + '';
+ if(!num.includes('.')){
+ num += '.'
+ }
+ return num.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
+ return $1 + ',';
+ }).replace(/\.$/, '');
}
}
diff --git a/src/views/other/directive.vue b/src/views/other/directive.vue
index 74523f4c..fe6a4347 100644
--- a/src/views/other/directive.vue
+++ b/src/views/other/directive.vue
@@ -1,15 +1,24 @@
- v-auth
+ v-auth 高精度权限控制
v-auth="'user.add'"
v-auth="['user.no','user.add']"
-
+
+