利用函数式store和storeToRefs可双向绑定

59 阅读1分钟

import { useAlldataStore } from '@/stores' import { storeToRefs } from 'pinia'; const { username,len } = storeToRefs(store); const width = computed(() => len.value.width);//这里的len我用了对象