工具集增加千分符,
This commit is contained in:
parent
59a5f1b1e2
commit
7df5825a21
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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(/\.$/, '');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,24 @@
|
|||
<template>
|
||||
<el-main>
|
||||
<el-card shadow="never">
|
||||
<h2 style="margin-bottom: 15px;">v-auth</h2>
|
||||
<h2 style="margin-bottom: 20px;">v-auth 高精度权限控制</h2>
|
||||
<el-button v-auth="'user.add'" type="primary">v-auth="'user.add'"</el-button>
|
||||
<el-button v-auth="['user.no','user.add']" type="primary">v-auth="['user.no','user.add']"</el-button>
|
||||
<el-alert title="v-auth指令 是$AUTH的语法糖, 原先需要使用v-if来判断是否有权限, 使用指令将减少代码冗余. 并且支持传入数组,有一项满足就判断有权限" style="margin-top: 15px;"></el-alert>
|
||||
<el-alert title="v-auth指令 是$AUTH的语法糖, 原先需要使用v-if来判断是否有权限, 使用指令将减少代码冗余. 并且支持传入数组,有一项满足就判断有权限" style="margin-top: 20px;"></el-alert>
|
||||
</el-card>
|
||||
|
||||
</el-main>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
created() {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue