mirror of
https://github.com/bitinflow/ui-old.git
synced 2026-03-13 13:45:57 +00:00
Fix state
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1 +1,3 @@
|
|||||||
.idea
|
.idea
|
||||||
|
node_modules
|
||||||
|
package-lock.json
|
||||||
@@ -29,8 +29,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {useMenuStore} from "../stores/menu";
|
|
||||||
import {mapState} from "pinia";
|
import {mapState} from "pinia";
|
||||||
|
import {useMenuStore} from "../stores/menu";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ThirdLevelMenu",
|
name: "ThirdLevelMenu",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {useMenuStore} from "~/stores/menu";
|
import {useMenuStore} from "../stores/menu";
|
||||||
|
|
||||||
export const useMenu = (data) => {
|
export const useMenu = (data) => {
|
||||||
const menu = useMenuStore()
|
const menu = useMenuStore()
|
||||||
|
|||||||
@@ -2,10 +2,9 @@
|
|||||||
"name": "@bitinflow/ui",
|
"name": "@bitinflow/ui",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"description": "Bitinflow UI Kit",
|
"description": "Bitinflow UI Kit",
|
||||||
"main": "index.js",
|
|
||||||
"scripts": {
|
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
|
||||||
},
|
|
||||||
"author": "René Preuß <rene@bitinflow.com>",
|
"author": "René Preuß <rene@bitinflow.com>",
|
||||||
"license": "Apache-2.0"
|
"license": "Apache-2.0",
|
||||||
|
"dependencies": {
|
||||||
|
"pinia": "^2.0.23"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
14
stores/menu.js
Normal file
14
stores/menu.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import {defineStore} from 'pinia';
|
||||||
|
|
||||||
|
export const useMenuStore = defineStore('menu', {
|
||||||
|
state: () => {
|
||||||
|
return {
|
||||||
|
thirdLevelLinks: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
updateThirdLevelLinks(links) {
|
||||||
|
this.thirdLevelLinks = links;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user