23 lines
604 B
JavaScript
23 lines
604 B
JavaScript
import { defineStore } from 'pinia';
|
||
import { computed,ref } from 'vue';
|
||
import { apiService } from "@/server/api.service";
|
||
export const useCounterStore = defineStore('counter',()=>{
|
||
//定义数据(state)
|
||
const count = ref(0);
|
||
const openId = ref('');
|
||
const cellPhone = ref('');
|
||
const isLogin = ref('');
|
||
|
||
//定义数据修改的方法(action)
|
||
const clickSType = (params)=>{
|
||
return apiService.post('/product/getPictureShareUrl',params)
|
||
}
|
||
//定义getters
|
||
// const doubleCount = computed(()=>count.value * 2)
|
||
|
||
//以对象的形式return供组件调用
|
||
return{
|
||
count,
|
||
clickSType
|
||
}
|
||
}) |