This commit is contained in:
Kulbhushan Kaushik 2022-09-20 15:27:01 -04:00
parent 9e969b8c86
commit bc473d5e03
3 changed files with 17 additions and 13 deletions

View file

@ -6,7 +6,6 @@
</transition> </transition>
</router-view> </router-view>
</template> </template>
<style lang="scss"> <style lang="scss">
@import "./node_modules/bootstrap/scss/bootstrap"; @import "./node_modules/bootstrap/scss/bootstrap";
@import "@/styles/common-animations.scss"; @import "@/styles/common-animations.scss";

View file

@ -1,8 +1,10 @@
<template> <template>
<form @submit.prevent="addYear(2024)"> <div>
Vehicle Make Placeholder <input type="text" v-model="year"/>
<button>Add</button> <span> Vehicle Make Placeholder </span>
</form> <span>{{returnVehicleYear}}</span>
<button @click="addYear(year)">Add</button>
</div>
</template> </template>
<script> <script>
@ -10,18 +12,18 @@
import { storeActions } from "@/constants/store-actions"; import { storeActions } from "@/constants/store-actions";
export default { export default {
name: 'vehicle-make', name: 'vehicle-make',
setup()
{
const store = issStore();
return {
store
}
},
methods: methods:
{ {
addYear(item) addYear(item)
{ {
this.store.saveVehicleYear(item); this.$store.saveVehicleYear(item);
}
},
computed:
{
returnVehicleYear()
{
return this.$store.order.vehicle.year;
} }
} }
} }

View file

@ -4,11 +4,14 @@ import App from './App.vue';
import router from './router'; import router from './router';
import "../node_modules/bootstrap/dist/js/bootstrap.js"; import "../node_modules/bootstrap/dist/js/bootstrap.js";
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'; import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
import { issStore } from './store';
const vueApp = createApp(App); const vueApp = createApp(App);
const pinia = createPinia(); const pinia = createPinia();
pinia.use(piniaPluginPersistedstate); pinia.use(piniaPluginPersistedstate);
vueApp.use(pinia); vueApp.use(pinia);
const store = issStore();
vueApp.config.globalProperties.$store = store;
vueApp.use(router); vueApp.use(router);
vueApp.mount("#app"); vueApp.mount("#app");