添加页面组件、添加页面组件接口、添加pinia
This commit is contained in:
17
src/stores/useSchemeStore.ts
Normal file
17
src/stores/useSchemeStore.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { IPageComponent } from '../type/IPageComponent';
|
||||
import { ref,computed } from 'vue';
|
||||
|
||||
export const useCounterStore = defineStore('counter', () => {
|
||||
const count = ref(0)
|
||||
const schema=ref<IPageComponent>()
|
||||
const doubleCount = computed(() => count.value * 2)
|
||||
function increment() {
|
||||
count.value++
|
||||
}
|
||||
function decrement() {
|
||||
count.value--
|
||||
}
|
||||
|
||||
return { count,schema, doubleCount, increment,decrement }
|
||||
})
|
||||
Reference in New Issue
Block a user