From 3af7e9821645fa8ef980cc3dd8afaa03779e52b6 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sun, 12 Feb 2023 16:06:00 +0100 Subject: [PATCH] basic pinia store --- vue/package.json | 3 +- vue/src/apps/RecipeView/main.js | 4 ++ vue/src/components/MealPlanEditModal.vue | 33 +++++----- vue/src/stores/BaseStorePlugin.js | 33 ++++++++++ vue/src/stores/UserPreferenceStore.js | 78 ++++++++++++++++++++++++ vue/src/stores/root.js | 0 6 files changed, 134 insertions(+), 17 deletions(-) create mode 100644 vue/src/stores/BaseStorePlugin.js create mode 100644 vue/src/stores/UserPreferenceStore.js create mode 100644 vue/src/stores/root.js diff --git a/vue/package.json b/vue/package.json index 0c3f3065..e812e5c6 100644 --- a/vue/package.json +++ b/vue/package.json @@ -13,6 +13,7 @@ "@popperjs/core": "^2.11.6", "@riophae/vue-treeselect": "^0.4.0", "@vue/cli": "^5.0.8", + "@vue/composition-api": "1.7.1", "axios": "^1.2.0", "babel": "^6.23.0", "babel-core": "^6.26.3", @@ -25,6 +26,7 @@ "lodash": "^4.17.21", "mavon-editor": "^2.10.4", "moment": "^2.29.4", + "pinia": "^2.0.30", "prismjs": "^1.29.0", "string-similarity": "^4.0.4", "vue": "^2.6.14", @@ -42,7 +44,6 @@ "vue-template-compiler": "2.6.14", "vue2-touch-events": "^3.2.2", "vuedraggable": "^2.24.3", - "vuex": "^3.6.0", "workbox-webpack-plugin": "^6.5.4", "workbox-window": "^6.5.4" }, diff --git a/vue/src/apps/RecipeView/main.js b/vue/src/apps/RecipeView/main.js index b5acd6a2..bbd3ad40 100644 --- a/vue/src/apps/RecipeView/main.js +++ b/vue/src/apps/RecipeView/main.js @@ -1,6 +1,7 @@ import Vue from 'vue' import App from './RecipeView.vue' import i18n from "@/i18n"; +import {createPinia, PiniaVuePlugin} from 'pinia' Vue.config.productionTip = false @@ -11,8 +12,11 @@ if (process.env.NODE_ENV === 'development') { } export default __webpack_public_path__ = publicPath // eslint-disable-line +Vue.use(PiniaVuePlugin) +const pinia = createPinia() new Vue({ + pinia, i18n, render: h => h(App), }).$mount('#app') diff --git a/vue/src/components/MealPlanEditModal.vue b/vue/src/components/MealPlanEditModal.vue index ba0b5e2a..3419801a 100644 --- a/vue/src/components/MealPlanEditModal.vue +++ b/vue/src/components/MealPlanEditModal.vue @@ -16,7 +16,7 @@ {{ $t("Title") }}
- + {{ $t("Date") }}
@@ -75,11 +75,11 @@ {{ $t("Share") }} - + {{ $t("AddToShopping") }} - + {{ $t("review_shopping") }} @@ -89,7 +89,7 @@
- {{ $t("Delete") }} + {{ $t("Delete") }} {{ $t("Save") }}
@@ -103,12 +103,14 @@