first commit

This commit is contained in:
Sas Andy
2024-08-12 08:42:51 +07:00
parent 6deeec116e
commit 2051b6439d
82 changed files with 78274 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
// components/ComponentA.js
const ComponentA = {
template: `
<div>
<h2>Component A</h2>
<p>Count: {{ count }}</p>
<v-btn @click="increment">Increment</v-btn>
<v-btn @click="decrement">Decrement</v-btn>
</div>
`,
computed: {
count() {
return this.$store.state.count;
}
},
methods: {
increment() {
this.$store.dispatch('increment');
},
decrement() {
this.$store.dispatch('decrement');
}
}
};

View File

@@ -0,0 +1,22 @@
// components/ComponentB.js
const ComponentB = {
template: `
<div>
<h2>Component B</h2>
<p>Data: {{ data }}</p>
<v-btn @click="fetchData">Fetch Data</v-btn>
</div>
`,
computed: {
data() {
return this.$store.state.data;
}
},
methods: {
async fetchData() {
await this.$store.dispatch('fetchData');
}
}
};