12345678910111213141516171819202122232425262728293031 |
- import {defineStore} from "pinia";
- import storage from "@/utils/storage";
- import platform from "@/utils/platform";
- export const useConfigStore = defineStore('config', {
- state: () => ({
- mType: 0, // 1 BMI;2 肺活量;3 视力;
- mName: '',
- platform,
- }),
- getters: {},
- actions: {
- _init() {
- // this.platform = ()
- this.getMachineType()
- },
- setMachineType(item) {
- storage.setKey('machineType', {
- name: item.name,
- type: item.type,
- })
- },
- getMachineType() {
- let info = storage.getKey('machineType')
- if (info) {
- this.mType = info.mType
- this.mName = info.mName
- }
- },
- }
- })
|