@neatui/vue 1.2.9 → 1.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +3 -1
  2. package/src/store/myui.ts +19 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neatui/vue",
3
- "version": "1.2.9",
3
+ "version": "1.2.11",
4
4
  "description": "basic component ui",
5
5
  "main": "./src/index.ts",
6
6
  "license": "MIT",
@@ -21,6 +21,8 @@
21
21
  "@fekit/toast": "^2.2.3",
22
22
  "@fekit/url": "^2.0.1",
23
23
  "@fekit/utils": "^2.10.7",
24
+ "compressorjs": "^1.2.1",
25
+ "echarts": "^5.5.0",
24
26
  "swiper": "^11.0.4",
25
27
  "vue-cropper": "^0.6.4",
26
28
  "vuedraggable": "^4.1.0"
package/src/store/myui.ts CHANGED
@@ -4,13 +4,11 @@ import { defineStore } from 'pinia';
4
4
  export const useMyuiStore = defineStore('myui', {
5
5
  state: () => {
6
6
  return {
7
- full: 0,
7
+ full: localStorage.getItem('neatui_full') || 0,
8
8
  // 字号
9
- fontSize: localStorage.getItem('fontSize') || 'm',
9
+ size: localStorage.getItem('neatui_size') || document?.documentElement?.getAttribute('size') || 'm',
10
10
  // 主题
11
- theme: localStorage.getItem('theme') || 'auto',
12
- // 所有主题
13
- themes: [],
11
+ theme: localStorage.getItem('neatui_theme') || document?.documentElement?.getAttribute('theme') || 'auto',
14
12
  // 侧边
15
13
  side: 1
16
14
  };
@@ -18,19 +16,29 @@ export const useMyuiStore = defineStore('myui', {
18
16
  getters: {},
19
17
  actions: {
20
18
  // 设置全屏显示
21
- async setFull(then = (res: any) => {}) {
19
+ async setfull(then = (res: any) => {}) {
22
20
  const full = this.full ? 0 : 1;
23
- localStorage.setItem('neatui_full', `${full}`);
24
21
  this.full = full;
22
+ localStorage.setItem('neatui_full', `${full}`);
25
23
  then(full);
26
24
  },
27
25
  // 设置系统主题
28
- async setTheme() {
29
- return document.documentElement.setAttribute('theme', this.theme);
26
+ async settheme(theme: any = '', then = (res: any) => {}) {
27
+ if (theme) {
28
+ localStorage.setItem('neatui_theme', theme);
29
+ this.theme = theme;
30
+ document.documentElement.setAttribute('theme', theme);
31
+ then(theme);
32
+ }
30
33
  },
31
34
  // 设置系统字号
32
- async setFontSize() {
33
- document.documentElement.setAttribute('size', this.fontSize);
35
+ async setsize(size: any = '', then = (res: any) => {}) {
36
+ if (size) {
37
+ localStorage.setItem('neatui_size', size);
38
+ this.theme = size;
39
+ document.documentElement.setAttribute('size', this.size);
40
+ then(size);
41
+ }
34
42
  }
35
43
  }
36
44
  });