You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
739 B

1 month ago
3 weeks ago
1 month ago
1 month ago
2 weeks ago
1 month ago
1 month ago
1 month ago
  1. import {defineStore} from 'pinia';
  2. const carStore = defineStore(
  3. 'car',
  4. {
  5. state: () => ({
  6. carInfo: {
  7. carType: 'car',//车型
  8. stepType: '1',//科目几
  9. carTypeName: '小车',
  10. contentType: '',//图片还是文字
  11. sift: '', //是否精选
  12. volume: '', //是否是密卷
  13. knowType: '',//分类
  14. chapter: '',//章节
  15. types: '',//题型
  16. city: '0',
  17. cityName: ''
  18. },
  19. webLink: 'https://www.baidu.com/'
  20. }),
  21. actions: {
  22. setCar(key, value) {
  23. // 类型只选一个
  24. let arr = ['knowType', 'chapter', 'types']
  25. if(arr.includes(key)) {
  26. arr.forEach(item=>{
  27. this.carInfo[item] = ''
  28. })
  29. }
  30. this.carInfo[key] = value
  31. },
  32. }
  33. })
  34. export default carStore