初版提交
Some checks failed
Deploy to GitHub Pages / Deploy to GitHub Pages (push) Has been cancelled

This commit is contained in:
2025-09-09 13:35:24 +08:00
parent c2c3237369
commit 77a83e363a
453 changed files with 34080 additions and 18016 deletions

View File

@ -0,0 +1,13 @@
import permissions from './permissions'
const install = function (Vue) {
Vue.directive('permissions', permissions)
}
if (window.Vue) {
window['permissions'] = permissions
Vue.use(install)
}
permissions.install = install
export default permissions

View File

@ -0,0 +1,13 @@
import store from '@/store'
export default {
inserted(element, binding) {
const { value } = binding
const permissions = store.getters['user/permissions']
if (value && value instanceof Array && value.length > 0) {
const hasPermission = permissions.some((role) => value.includes(role))
if (!hasPermission)
element.parentNode && element.parentNode.removeChild(element)
}
},
}

57
layouts/index.js Normal file
View File

@ -0,0 +1,57 @@
/**
* @description Vue Admin Better 项目配置
*/
const webpackBarName = 'vue-admin-better'
const webpackBanner = (time) =>
`vue-admin-better
GitHub: https://github.com/zxwk1998/vue-admin-better
Gitee: https://gitee.com/chu1204505056/vue-admin-better
版权所有 (c) 2025 vue-admin-better
本项目使用 MIT 许可证
构建时间: ${time}`
/**
* @description 在控制台打印项目信息
*/
function donationConsole() {
const chalk = require('chalk')
console.log(
chalk.green(
`> 欢迎使用vue-admin-bettergithub开源地址https://github.com/zxwk1998/vue-admin-better`
)
)
console.log(
chalk.green(
`> 欢迎使用vue-admin-better码云开源地址https://gitee.com/chu1204505056/vue-admin-better`
)
)
console.log(chalk.green(`> pro版演示地址http://vuejs-core.cn/admin-pro`))
console.log(chalk.green(`> plus版演示地址http://vuejs-core.cn/admin-plus`))
console.log(chalk.green(`> shop版演示地址http://vuejs-core.cn/shop-vite`))
console.log(
chalk.green(
`> 找好工作就到【好工作就业参考网】查看就业避坑指南https://job.vuejs-core.cn/`
)
)
console.log(
chalk.green(
`> 使用中出现任何问题可加QQ群反馈获取基础版、文档请我们喝杯咖啡如若情况不允许请勿勉强https://gitee.com/chu1204505056/vue-admin-better#-%E5%89%8D%E7%AB%AF%E8%AE%A8%E8%AE%BA-qq-%E7%BE%A4`
)
)
console.log(chalk.green(`> 如果您不希望显示以上信息可在config中配置关闭`))
console.log('\n')
}
module.exports = {
webpackBarName,
webpackBanner,
donationConsole,
}

5
layouts/package.json Normal file
View File

@ -0,0 +1,5 @@
{
"name": "layouts",
"version": "1.0.0",
"main": "index.js"
}

View File

@ -0,0 +1,16 @@
module.exports = {
printWidth: 80,
tabWidth: 2,
useTabs: false,
semi: false,
singleQuote: true,
quoteProps: 'as-needed',
jsxSingleQuote: false,
trailingComma: 'es5',
bracketSpacing: true,
jsxBracketSameLine: false,
arrowParens: 'always',
htmlWhitespaceSensitivity: 'ignore',
vueIndentScriptAndStyle: true,
endOfLine: 'lf',
}