@ektx/v-macos
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "@ektx/v-macos", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "系统主框架", | ||
@@ -15,3 +15,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"@ektx/v-menubar": "0.0.2" | ||
"@ektx/v-menubar": "0.0.2", | ||
"@ektx/v-contextmenu": "^0.2.6" | ||
}, | ||
@@ -18,0 +19,0 @@ "author": "ektx", |
@@ -8,2 +8,8 @@ // 右键菜单组件 | ||
name: 'VMacOSDesktop', | ||
props: { | ||
hasRootNav: { | ||
type: Boolean, | ||
default: false | ||
} | ||
}, | ||
components: { | ||
@@ -17,16 +23,22 @@ VContextmenu, | ||
}), | ||
beforeCreate () { | ||
// 在 vuex 上设置默认值 | ||
this.$set(this.$store.state, 'MacOSTopbar', { | ||
// 主菜单 | ||
created () { | ||
let options = { | ||
mainNav: {}, | ||
// 右边菜单 | ||
asideNav: {}, | ||
root: [ | ||
root: [] | ||
} | ||
if (this.hasRootNav) { | ||
options.root = [ | ||
{ | ||
title: '🔺', | ||
title: '主页', | ||
children: [ | ||
{ | ||
title: '主页', | ||
to: '/' | ||
title: '最近访问', | ||
children: [ | ||
{ | ||
title: '主页', | ||
to: '/' | ||
} | ||
] | ||
} | ||
@@ -36,4 +48,7 @@ ] | ||
] | ||
}) | ||
} | ||
// 在 vuex 上设置默认值 | ||
this.$set(this.$store.state, 'MacOSTopbar', options) | ||
} | ||
} |
@@ -28,3 +28,3 @@ # v-macos | ||
<template> | ||
<VMacOSDesktop/> | ||
<VMacOSDesktop hasRootNav /> | ||
</template> | ||
@@ -34,3 +34,2 @@ ``` | ||
import { VMacOSDesktop } from '@ektx/v-macos' | ||
import { mapMutations } from 'vuex' | ||
@@ -45,1 +44,14 @@ export default { | ||
- hasRootNav `[boolean]` 是否启用组件自定义菜单 | ||
### store.js 配置 | ||
```js | ||
// 引用对主菜单 mutation | ||
import { MutaionMacOSTopbar } from '@ektx/v-macos' | ||
export default new Vuex.Store({ | ||
mutations: { | ||
MutaionMacOSTopbar | ||
} | ||
}) | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5977
79
54
2
+ Added@ektx/v-contextmenu@^0.2.6
+ Added@ektx/v-contextmenu@0.2.8(transitive)