Fix state

This commit is contained in:
René Preuß
2022-10-30 14:27:53 +01:00
parent 11570c9832
commit ed44357418
5 changed files with 23 additions and 8 deletions

4
.gitignore vendored
View File

@@ -1 +1,3 @@
.idea
.idea
node_modules
package-lock.json

View File

@@ -29,8 +29,8 @@
</template>
<script>
import {useMenuStore} from "../stores/menu";
import {mapState} from "pinia";
import {useMenuStore} from "../stores/menu";
export default {
name: "ThirdLevelMenu",

View File

@@ -1,4 +1,4 @@
import {useMenuStore} from "~/stores/menu";
import {useMenuStore} from "../stores/menu";
export const useMenu = (data) => {
const menu = useMenuStore()

View File

@@ -2,10 +2,9 @@
"name": "@bitinflow/ui",
"version": "0.0.1",
"description": "Bitinflow UI Kit",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"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
View File

@@ -0,0 +1,14 @@
import {defineStore} from 'pinia';
export const useMenuStore = defineStore('menu', {
state: () => {
return {
thirdLevelLinks: []
}
},
actions: {
updateThirdLevelLinks(links) {
this.thirdLevelLinks = links;
},
},
})