//test.vue
<template>
<view>
<text>123</text>
</view>
</template>
<!-- 这里去掉setup会在鸿蒙应用白屏 -->
<script setup>
import {
useMainStore
} from "@/stores/main";
const mainStore = useMainStore()
console.log("mainStore-----2", mainStore)
</script>
<style>
</style>
//store/main.js
import { defineStore } from 'pinia';
export const useMainStore = defineStore('main', {
state: () => ({
count: 0,
token: '',
version: '',
uniPlatform: '',
}),
actions: {
increment() {
this.count++;
},
},
});
云开发接单 (作者)
简单的demo
已经上传在下面评论的附件
2025-08-12 19:08
云开发接单 (作者)
模拟器系统是:HarmonyOS 5.1.1
2025-08-12 20:21
云开发接单 (作者)
能复现吗,着急使用,老项目改造太麻烦
2025-08-12 20:27