@netang/quasar 0.0.73 → 0.0.75

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.
@@ -9,7 +9,10 @@
9
9
  />
10
10
 
11
11
  <!-- 描述文字 -->
12
- <div class="text-subtitle1 text-grey-7" v-if="description">{{description}}</div>
12
+ <div
13
+ :class="descriptionClass"
14
+ v-if="description"
15
+ >{{description}}</div>
13
16
  </div>
14
17
  </template>
15
18
 
@@ -37,6 +40,11 @@ export default {
37
40
  type: [ String, Number ],
38
41
  default: 70,
39
42
  },
43
+ // 描述类名
44
+ descriptionClass: {
45
+ type: String,
46
+ default: 'text-subtitle1 text-grey-7',
47
+ },
40
48
  // 描述文字
41
49
  description: String,
42
50
  },
@@ -1,16 +1,28 @@
1
1
  <template>
2
+ <div v-if="container">
3
+ <!-- 空数据 -->
4
+ <n-empty
5
+ :description="emptyDescription"
6
+ v-if="pageStatus === false"
7
+ />
8
+ <!-- 插槽 -->
9
+ <slot v-else-if="pageStatus === true" />
10
+ <!-- 加载 -->
11
+ <q-inner-loading
12
+ :showing="pageLoading"
13
+ />
14
+ </div>
2
15
  <q-page
3
16
  v-bind="$attrs"
17
+ v-else
4
18
  >
5
19
  <!-- 空数据 -->
6
20
  <n-empty
7
21
  :description="emptyDescription"
8
22
  v-if="pageStatus === false"
9
23
  />
10
-
11
24
  <!-- 插槽 -->
12
25
  <slot v-else-if="pageStatus === true" />
13
-
14
26
  <!-- 加载 -->
15
27
  <q-inner-loading
16
28
  :showing="pageLoading"
@@ -32,6 +44,14 @@ export default {
32
44
  */
33
45
  name: 'NPowerPage',
34
46
 
47
+ /**
48
+ * 声明属性
49
+ */
50
+ props: {
51
+ // 是否容器化
52
+ container: Boolean,
53
+ },
54
+
35
55
  /**
36
56
  * 组件
37
57
  */
@@ -43,14 +63,27 @@ export default {
43
63
  * 组合式
44
64
  */
45
65
  setup() {
66
+
46
67
  // ==========【数据】============================================================================================
47
68
 
48
69
  // 获取注入权限数据
49
- const $power = inject(NPowerKey)
70
+ const {
71
+ // 页面状态
72
+ pageStatus,
73
+ // 空状态描述
74
+ emptyDescription,
75
+ // 页面加载
76
+ pageLoading,
77
+ } = inject(NPowerKey)
50
78
 
51
79
  // ==========【返回】============================================================================================
52
80
  return {
53
- ...$power,
81
+ // 页面状态
82
+ pageStatus,
83
+ // 空状态描述
84
+ emptyDescription,
85
+ // 页面加载
86
+ pageLoading,
54
87
  }
55
88
  },
56
89
  }
@@ -5,8 +5,18 @@
5
5
  :width="toPx(size)"
6
6
  :height="toPx(size)"
7
7
  fit="fill"
8
+ v-bind="$attrs"
8
9
  v-if="currentSrc"
9
10
  >
11
+ <template v-slot:error>
12
+ <div class="absolute-full flex flex-center bg-grey-5 text-white no-padding">
13
+ <q-icon
14
+ :size="errorIconSize"
15
+ :name="errorIcon"
16
+ />
17
+ </div>
18
+ </template>
19
+
10
20
  <!-- 预览点击 -->
11
21
  <div
12
22
  class="absolute-full transparent cursor-pointer"
@@ -15,6 +25,21 @@
15
25
  v-if="preview"
16
26
  ></div>
17
27
  </q-img>
28
+
29
+ <!-- 错误图标 -->
30
+ <div
31
+ class="flex flex-center bg-grey-5 text-white no-padding"
32
+ :style="{
33
+ width: toPx(size),
34
+ height: toPx(size),
35
+ }"
36
+ v-else
37
+ >
38
+ <q-icon
39
+ :size="errorIconSize"
40
+ :name="errorIcon"
41
+ />
42
+ </div>
18
43
  </template>
19
44
 
20
45
  <script>
@@ -24,8 +49,8 @@ import { useQuasar } from 'quasar'
24
49
  import $n_px from '@netang/utils/px'
25
50
  import $n_noop from '@netang/utils/noop'
26
51
 
27
- import $n_previewImage from '../../utils/previewImage'
28
52
  import $n_getImage from '../../utils/getImage'
53
+ import $n_previewImage from '../../utils/previewImage'
29
54
 
30
55
  export default {
31
56
 
@@ -34,6 +59,11 @@ export default {
34
59
  */
35
60
  name: 'NThumbnail',
36
61
 
62
+ /**
63
+ * 关闭组件 attribute 透传行为
64
+ */
65
+ inheritAttrs: false,
66
+
37
67
  /**
38
68
  * 声明属性
39
69
  */
@@ -45,6 +75,16 @@ export default {
45
75
  type: Number,
46
76
  default: 40,
47
77
  },
78
+ // 错误图标大小
79
+ errorIconSize: {
80
+ type: String,
81
+ default: 'sm',
82
+ },
83
+ // 错误图标
84
+ errorIcon: {
85
+ type: String,
86
+ default: 'image',
87
+ },
48
88
  // 是否点击放大预览
49
89
  preview: Boolean,
50
90
  },
@@ -86,7 +126,6 @@ export default {
86
126
  currentSrc,
87
127
  // 预览
88
128
  onPreview,
89
-
90
129
  // 转像素
91
130
  toPx: $n_px,
92
131
  // 点击空方法
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netang/quasar",
3
- "version": "0.0.73",
3
+ "version": "0.0.75",
4
4
  "description": "netang-quasar",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -20,7 +20,6 @@
20
20
  "homepage": "https://github.com/netangsoft/netang-quasar#readme",
21
21
  "dependencies": {
22
22
  "axios": "^1.3.2",
23
- "spark-md5": "^3.0.2",
24
- "xregexp": "^5.1.1"
23
+ "spark-md5": "^3.0.2"
25
24
  }
26
25
  }
package/utils/useAuth.js CHANGED
@@ -9,8 +9,9 @@ export function initAuthStore() {
9
9
  const cache = $n_cookie.get('_tk')
10
10
  return checkUserInfo(cache) ? cache : {
11
11
  id: 0,
12
- isLogin: false,
12
+ token: '',
13
13
  info: {},
14
+ isLogin: false,
14
15
  }
15
16
  }
16
17