"use strict"; const common_vendor = require("../../common/vendor.js"); const carStore = common_vendor.defineStore( "car", { state: () => ({ carInfo: { carType: "car", //车型 stepType: "1", //科目几 carTypeName: "小车", contentType: "", //图片还是文字 sift: "", //是否精选 volume: "", //是否是密卷 knowType: "", //分类 chapter: "", //章节 types: "", //题型 city: "0", cityName: "" }, webLink: "https://www.baidu.com/" }), actions: { setCar(key, value) { let arr = ["knowType", "chapter", "types"]; if (arr.includes(key)) { arr.forEach((item) => { this.carInfo[item] = ""; }); } this.carInfo[key] = value; } } } ); exports.carStore = carStore;