1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| import {
| defineStore
| } from 'pinia';
|
| export const useDeviceStore = defineStore('device', {
| state: () => ({
| // 设备状态,使用对象或数组等复杂数据结构也可以
| device: null, // 初始值设置为 null 或其他合适的默认值
| }),
| actions: {
| // 编辑设备具体信息
| function editDevice(deviceInfo) {
| this.device = deviceInfo;
| }
| }
| });
|
|