合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
[TOC] ## 使用 ### 注册 ``` import { createApp } from 'vue' import { createPinia } from 'pinia' import App from './App.vue' const pinia = createPinia() const app = createApp(App) app.use(pinia) app.mount('#app') ``` ### 组合式基础示例 ``` import {defineStore} from 'pinia'; import {ref} from 'vue'; export const businessStore = defineStore('business', ()=>{ const business= ref({ business_id:"", business_name:"", }); const save_business=(data)=>{ business.value.business_id=data?.business_id; business.value.business_name=data?.business_name; } const get_business_id=()=>{ return business.value.business_id } const get_business_name=()=>{ return business.value.business_name } return { business, save_business, get_business_id, get_business_name } }); ```