Files
lowcode-frontend/src/stores/useSchemeStore.ts
2024-10-02 20:41:44 +08:00

22 lines
535 B
TypeScript

import { defineStore } from 'pinia'
import { IPageComponent } from '../type/IPageComponent';
import { ref,computed } from 'vue';
export const useCounterStore = defineStore('counter', () => {
const count = ref(0)
const scheme=ref<IPageComponent>()
const doubleCount = computed(() => count.value * 2)
function increment() {
count.value++
}
function decrement() {
count.value--
}
function initScheme(value)
{
scheme.value=value
}
return { count,scheme, doubleCount, increment,decrement,initScheme }
})