49 lines
901 B
Vue
49 lines
901 B
Vue
<template>
|
|
<div>
|
|
<v-container class="mb-6">
|
|
<h1>Component 2</h1>
|
|
</v-container>
|
|
</div>
|
|
</template>
|
|
|
|
<script type="module">
|
|
export default {
|
|
name: "component2",
|
|
computed: {
|
|
// Akses state dari store
|
|
count() {
|
|
return this.$store.state.count;
|
|
},
|
|
email() {
|
|
return this.$store.state.email;
|
|
},
|
|
},
|
|
methods: {
|
|
// Dispatch action ke store
|
|
increment() {
|
|
this.$store.dispatch("increment");
|
|
},
|
|
},
|
|
};
|
|
// export default {
|
|
// name: "HelloWorld",
|
|
// // setup() {
|
|
// // // const store = useStore();
|
|
// // const email = computed(() => $store.state.email);
|
|
// // },
|
|
// computed: {
|
|
// email: {
|
|
// get() {
|
|
// return this.$store.state.store.email;
|
|
// },
|
|
// },
|
|
// },
|
|
// };
|
|
</script>
|
|
|
|
<style scoped>
|
|
h1 {
|
|
color: blue;
|
|
}
|
|
</style>
|