@netang/quasar 0.0.53 → 0.0.55

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 (115) hide show
  1. package/_docs/docs/.vuepress/client.js +39 -0
  2. package/_docs/docs/.vuepress/components/test.vue +23 -0
  3. package/_docs/docs/.vuepress/config.js +40 -0
  4. package/_docs/docs/.vuepress/configs/index.js +2 -0
  5. package/_docs/docs/.vuepress/configs/navbar/index.js +1 -0
  6. package/_docs/docs/.vuepress/configs/navbar/zh.js +16 -0
  7. package/_docs/docs/.vuepress/configs/sidebar/index.js +1 -0
  8. package/_docs/docs/.vuepress/configs/sidebar/zh.js +20 -0
  9. package/_docs/docs/.vuepress/public/css/index.css +3 -0
  10. package/_docs/docs/.vuepress/styles/index.scss +3 -0
  11. package/_docs/docs/components/field-table.md +63 -0
  12. package/_docs/docs/components/field-tree.md +1 -0
  13. package/{docs → _docs}/docs/index.md +0 -0
  14. package/{docs → _docs}/docs/utils/alert.md +0 -0
  15. package/{docs → _docs}/docs/utils/confirm.md +0 -0
  16. package/_docs/docs/utils/index.md +1 -0
  17. package/_docs/package.json +17 -0
  18. package/components/column-title/index.vue +2 -2
  19. package/components/data/index.vue +20 -23
  20. package/components/dialog/index.vue +26 -12
  21. package/components/dialog-table/index.vue +4 -2
  22. package/components/dragger/index.vue +3 -2
  23. package/components/drawer/index.vue +16 -9
  24. package/components/editor-code/index.vue +12 -5
  25. package/components/empty/index.vue +16 -1
  26. package/components/field-date/index.vue +48 -36
  27. package/components/field-table/index.vue +69 -43
  28. package/components/field-text/index.vue +6 -2
  29. package/components/field-tree/index.vue +40 -22
  30. package/components/input-number/index.vue +5 -4
  31. package/components/list-menu/index.vue +14 -2
  32. package/components/power-page/index.vue +10 -0
  33. package/components/private/components/index.js +7 -2
  34. package/components/private/components/move-to-tree/index.vue +7 -3
  35. package/components/private/edit-power-data/index.vue +92 -52
  36. package/components/private/table-visible-columns-button/index.vue +6 -2
  37. package/components/render/index.vue +21 -7
  38. package/components/search/index.vue +30 -2
  39. package/components/search-item/index.vue +24 -8
  40. package/components/select/index.vue +5 -2
  41. package/components/splitter/index.vue +13 -9
  42. package/components/table/index.vue +32 -5
  43. package/components/table-pagination/index.vue +0 -1
  44. package/components/table-splitter/index.vue +22 -3
  45. package/components/table-summary/index.vue +10 -3
  46. package/components/thumbnail/index.vue +16 -6
  47. package/components/toolbar/index.vue +0 -2
  48. package/components/uploader/index.vue +5 -2
  49. package/components/uploader-query/index.vue +48 -27
  50. package/components/value-format/index.vue +19 -12
  51. package/configs/area3.js +1 -0
  52. package/docs/404.html +33 -0
  53. package/docs/assets/404.html-60b35caa.js +1 -0
  54. package/docs/assets/404.html-d1e63d77.js +1 -0
  55. package/docs/assets/alert.html-568d4e94.js +1 -0
  56. package/docs/assets/alert.html-f5dbc3e9.js +1 -0
  57. package/docs/assets/app-8c3ae4de.js +6 -0
  58. package/docs/assets/back-to-top-8efcbe56.svg +1 -0
  59. package/docs/assets/confirm.html-7a1566f6.js +1 -0
  60. package/docs/assets/confirm.html-96f1b004.js +1 -0
  61. package/docs/assets/field-table.html-68d610b0.js +1 -0
  62. package/docs/assets/field-table.html-86cc3511.js +1 -0
  63. package/docs/assets/field-tree.html-45410c3c.js +1 -0
  64. package/docs/assets/field-tree.html-c98ac993.js +1 -0
  65. package/docs/assets/framework-204010b2.js +5 -0
  66. package/docs/assets/index.html-1695dd7c.js +1 -0
  67. package/docs/assets/index.html-65a4aa67.js +1 -0
  68. package/docs/assets/style-ac5a9aa6.css +1 -0
  69. package/docs/components/field-table.html +33 -0
  70. package/docs/components/field-tree.html +33 -0
  71. package/docs/index.html +33 -0
  72. package/docs/utils/alert.html +33 -0
  73. package/docs/utils/confirm.html +33 -0
  74. package/package.json +1 -1
  75. package/package2.json +30 -0
  76. package/store/index.js +3 -20
  77. package/utils/alert.js +3 -1
  78. package/utils/area.js +27 -14
  79. package/utils/arr.js +6 -2
  80. package/utils/auth.js +40 -35
  81. package/utils/bus.js +1 -1
  82. package/utils/config.js +42 -15
  83. package/utils/{confrim.js → confirm.js} +1 -1
  84. package/utils/copy.js +18 -0
  85. package/utils/dialog.js +7 -3
  86. package/utils/dict.js +5 -28
  87. package/utils/dictOptions.js +24 -0
  88. package/utils/form.js +6 -2
  89. package/utils/getData.js +21 -9
  90. package/utils/getFile.js +11 -5
  91. package/utils/getImage.js +23 -12
  92. package/utils/getTime.js +9 -4
  93. package/utils/index.js +61 -0
  94. package/utils/loading.js +3 -1
  95. package/utils/notify.js +1 -1
  96. package/utils/power.js +164 -118
  97. package/utils/previewImage.js +4 -2
  98. package/utils/price.js +12 -3
  99. package/utils/rule.js +5 -9
  100. package/utils/ruleValid.js +10 -0
  101. package/utils/search.js +81 -50
  102. package/utils/table.js +119 -87
  103. package/utils/timestamp.js +2 -2
  104. package/utils/toast.js +1 -1
  105. package/utils/tree.js +69 -46
  106. package/utils/uploader/qiniu.js +31 -15
  107. package/utils/uploader.js +87 -56
  108. package/utils/useAuth.js +12 -5
  109. package/utils/useRouter.js +16 -5
  110. package/utils/useUploader.js +0 -5
  111. package/docs/docs/.vuepress/config.js +0 -32
  112. package/docs/docs/components/field-table.md +0 -1
  113. package/docs/docs/components/field-tree.md +0 -1
  114. package/docs/package.json +0 -11
  115. package/utils/http.js +0 -251
@@ -0,0 +1,39 @@
1
+ import { defineClientConfig } from '@vuepress/client'
2
+
3
+ // quasar
4
+ import { Quasar, Dialog, Notify, Loading } from 'quasar'
5
+ import lang from 'quasar/lang/zh-CN.js'
6
+ import '@quasar/extras/material-icons/material-icons.css'
7
+ import "quasar/src/css/variables.sass";
8
+ import "quasar/dist/quasar.sass";
9
+ lang.date.firstDayOfWeek = 1
10
+ lang.table.recordsPerPage = ''
11
+
12
+ import MyComponent from './components/test.vue'
13
+
14
+ export default defineClientConfig({
15
+ enhance({ app }) {
16
+
17
+ // quasar
18
+ app.use(Quasar, {
19
+ // 配置
20
+ config: {
21
+
22
+ },
23
+ // 插件
24
+ plugins: {
25
+ // 对话框
26
+ Dialog,
27
+ // 通知
28
+ Notify,
29
+ // 加载
30
+ Loading,
31
+ },
32
+ // 语言
33
+ lang,
34
+ })
35
+
36
+
37
+ app.component('test', MyComponent)
38
+ },
39
+ })
@@ -0,0 +1,23 @@
1
+ <template>
2
+ <q-badge color="blue">
3
+ #4D96F2
4
+ </q-badge>
5
+ <q-btn
6
+ label="test"
7
+ @click="onTest"
8
+ />
9
+ </template>
10
+
11
+ <script>
12
+ import uniq from 'lodash/uniq'
13
+ import test from 'utils/test'
14
+ export default {
15
+ setup() {
16
+ return {
17
+ onTest() {
18
+ console.log(3333, test)
19
+ }
20
+ }
21
+ }
22
+ }
23
+ </script>
@@ -0,0 +1,40 @@
1
+ import path from 'path'
2
+ import { defineUserConfig } from '@vuepress/cli'
3
+ import { defaultTheme } from '@vuepress/theme-default'
4
+ import { searchPlugin } from '@vuepress/plugin-search'
5
+
6
+ import {
7
+ navbarZh,
8
+ sidebarZh,
9
+ } from './configs'
10
+
11
+ export default defineUserConfig({
12
+ // 站点的标题
13
+ title: 'netang-quasar',
14
+ // 部署站点的基础路径
15
+ base: '/netang-quasar/',
16
+ // 打包目录
17
+ dest: path.join(__dirname, '../../../docs'),
18
+ // 主题
19
+ theme: defaultTheme({
20
+ locales: {
21
+ '/': {
22
+ // navbar
23
+ navbar: navbarZh,
24
+ // sidebar
25
+ sidebar: sidebarZh,
26
+ },
27
+ },
28
+ }),
29
+ // 插件
30
+ plugins: [
31
+ // 搜索
32
+ searchPlugin({
33
+ locales: {
34
+ '/': {
35
+ placeholder: '搜索',
36
+ },
37
+ },
38
+ }),
39
+ ],
40
+ })
@@ -0,0 +1,2 @@
1
+ export * from './navbar'
2
+ export * from './sidebar'
@@ -0,0 +1 @@
1
+ export * from './zh'
@@ -0,0 +1,16 @@
1
+ export const navbarZh = [
2
+ {
3
+ text: '首页',
4
+ link: '/',
5
+ },
6
+ {
7
+ text: '组件',
8
+ activeMatch: '/components/',
9
+ link: '/components/field-table',
10
+ },
11
+ {
12
+ text: '工具',
13
+ activeMatch: '/utils/',
14
+ link: '/utils/alert',
15
+ },
16
+ ]
@@ -0,0 +1 @@
1
+ export * from './zh'
@@ -0,0 +1,20 @@
1
+ export const sidebarZh = {
2
+ '/components/': [
3
+ {
4
+ text: 'Components 组件',
5
+ children: [
6
+ '/components/field-table',
7
+ '/components/field-tree',
8
+ ],
9
+ }
10
+ ],
11
+ '/utils/': [
12
+ {
13
+ text: 'Utils 工具',
14
+ children: [
15
+ '/utils/alert',
16
+ '/utils/confirm',
17
+ ],
18
+ }
19
+ ],
20
+ }
@@ -0,0 +1,3 @@
1
+ :root {
2
+ --content-width: 1200px !important;
3
+ }
@@ -0,0 +1,3 @@
1
+ body {
2
+ --content-width: 1200px !important;
3
+ }
@@ -0,0 +1,63 @@
1
+ # FieldTable 下拉表格
2
+
3
+ ::: tip
4
+ 继承 `<q-field>` 所有特性
5
+ [中文文档](http://www.quasarchs.com/vue-components/field) [英文文档](https://quasar.dev/vue-components/field)
6
+ :::
7
+
8
+ 123
9
+
10
+ <test />
11
+
12
+ 456
13
+
14
+ ## FieldTable API
15
+
16
+ ### FieldTable 属性
17
+
18
+ | 属性名 | 说明 | 类型 | 可选值 | 默认值 |
19
+ |--------------------------|-------------|---------------------|------------------------------------------|-----------------|
20
+ | value / v-model | 绑定值 | - | - | - |
21
+ | value-key | 值字段 | `String` | - | - |
22
+ | label-key | 标签字段 | `String` | - | - |
23
+ | value-type | 值类型 | `String` | `string` / `stringArray` / `objectArray` | objectArray |
24
+ | value-separator | 值分隔符 | `String` | - | , |
25
+ | path | 表格请求路径 | `String` | - | - |
26
+ | query | 请求参数 | `object` | - | - |
27
+ | data | 附加请求数据 | `object` | - | - |
28
+ | no-default-load-selected | 初始不加载已选数据 | `Boolean` | - | false |
29
+ | no-update-load-selected | 更新值时不加载已选数据 | `Boolean` | - | false |
30
+ | format-label | 格式化显示标签 | `Function` | - | - |
31
+ | show-keys | 下拉表格显示的字段数组 | `Array` | - | `[ 值字段, 标签字段 ]` |
32
+ | hide-search-keys | 隐藏搜索字段数组 | `Array` | - | - |
33
+ | filter-key | 默认筛选字段 | `Array` | - | `标签字段` |
34
+ | filter | 是否开启筛选 | `Boolean` | - | false |
35
+ | table-props | 表格声明属性 | `Object` | - | - |
36
+ | dialog-props | 对话框声明属性 | `Object` | - | - |
37
+ | no-dialog | 关闭对话框 | `Boolean` | - | false |
38
+ | columns | 表格列数据 | `Array` | - | - |
39
+ | rows | 行数据 | `Array` | - | - |
40
+ | multiple | 是否多选 | `Boolean` | - | false |
41
+ | collapse-tags | 多选模式下是否折叠标签 | `Boolean` | - | false |
42
+ | placeholder | 占位符 | `String` | - | - |
43
+ | clearable | 是否可清除 | `Boolean` | - | false |
44
+ | disable | 是否禁用 | `Boolean` | - | false |
45
+ | readonly | 是否只读 | `Boolean` | - | false |
46
+ | input-debounce | 输入防抖(毫秒) | `Number` / `String` | - | 500 |
47
+
48
+
49
+ ### FieldTable 插槽
50
+
51
+ | 插槽名 | 说明 |
52
+ |--------------------------|------------------------------------------|
53
+ | default | 自定义默认内容(如果存在,则会隐藏下拉表格,并提供接口自定义实现) |
54
+
55
+ ### FieldTable `default` 默认插槽 对外暴露的方法
56
+
57
+ | 属性名 | 说明 | 类型 | 示例 |
58
+ |--------------------------|--|----------|-----|
59
+ | showValue | 显示的已选值 | `String` | - |
60
+ | selected | 已选数据 | `Array` | `[ { id: 1, ... }, { id: 2, ... } ]` |
61
+ | onRemove | 删除已选 | `Function` | `onRemove(index)` |
62
+ | onShowDialog | 显示对话框 | `Function` | - |
63
+ | onClear | 清空已选数据 | `Function` | - |
@@ -0,0 +1 @@
1
+ # FieldTree 下拉树
File without changes
File without changes
File without changes
@@ -0,0 +1 @@
1
+ # utils
@@ -0,0 +1,17 @@
1
+ {
2
+ "private": true,
3
+ "scripts": {
4
+ "docs:dev": "vuepress dev docs",
5
+ "docs:build": "vuepress build docs"
6
+ },
7
+ "devDependencies": {
8
+ "@quasar/extras": "^1.15.10",
9
+ "@vuepress/plugin-search": "^2.0.0-beta.60",
10
+ "axios": "^1.3.2",
11
+ "lodash": "^4.17.21",
12
+ "quasar": "^2.11.5",
13
+ "vue": "^3.2.47",
14
+ "vuepress": "^2.0.0-beta.60",
15
+ "utils": "^4.17.21"
16
+ }
17
+ }
@@ -27,9 +27,9 @@ export default {
27
27
  */
28
28
  props: {
29
29
  // 标签
30
- label: [String, Number],
30
+ label: [ String, Number ],
31
31
  // 提示信息
32
- tooltip: [String, Number],
32
+ tooltip: [ String, Number ],
33
33
  },
34
34
  }
35
35
  </script>
@@ -1,23 +1,20 @@
1
- <template>
2
- <slot :data="data" />
3
- </template>
4
-
5
- <script>
6
- export default {
7
- /**
8
- * 标识
9
- */
10
- name: 'NData',
11
-
12
- /**
13
- * 传参
14
- */
15
- props: {
16
- // 数据
17
- data: {},
18
- },
19
- }
20
- </script>
21
-
22
- <style>
23
- </style>
1
+ <template>
2
+ <slot :data="data" />
3
+ </template>
4
+
5
+ <script>
6
+ export default {
7
+ /**
8
+ * 标识
9
+ */
10
+ name: 'NData',
11
+
12
+ /**
13
+ * 传参
14
+ */
15
+ props: {
16
+ // 数据
17
+ data: {},
18
+ },
19
+ }
20
+ </script>
@@ -52,11 +52,26 @@
52
52
  import { ref, computed, defineAsyncComponent, provide, watch } from 'vue'
53
53
  import { useDialogPluginComponent, useQuasar } from 'quasar'
54
54
 
55
- import routers from '@/router/routers'
55
+ import $n_has from 'lodash/has'
56
+ import $n_get from 'lodash/get'
57
+ import $n_isFunction from 'lodash/isFunction'
58
+
59
+ import $n_indexOf from '@netang/utils/indexOf'
60
+ import $n_runAsync from '@netang/utils/runAsync'
61
+ import $n_slash from '@netang/utils/slash'
62
+ import $n_px from '@netang/utils/px'
56
63
 
57
64
  import components from '../private/components'
58
65
  import { NDialogKey } from '../../utils/symbols'
59
66
 
67
+ import $n_toast from '../../utils/toast'
68
+ import { configs } from '../../utils/config'
69
+
70
+ const {
71
+ // 自定义路由
72
+ routers,
73
+ } = configs
74
+
60
75
  export default {
61
76
 
62
77
  /**
@@ -184,10 +199,10 @@ export default {
184
199
 
185
200
  function setWH(style, field, sign) {
186
201
  if (props[field]) {
187
- if ($n.indexOf(props[field], '%') > -1) {
202
+ if ($n_indexOf(props[field], '%') > -1) {
188
203
  style[field] = props[field].replace('%', sign)
189
204
  } else {
190
- style[field] = $n.px(props[field])
205
+ style[field] = $n_px(props[field])
191
206
  }
192
207
  }
193
208
  }
@@ -231,10 +246,10 @@ export default {
231
246
  // 如果是路由路径
232
247
  if (props.route) {
233
248
  // 获取路由组件
234
- comp = $n.get(routers, `${$n.slash(props.route, 'start', false)}.component`)
249
+ comp = $n_get(routers, `${$n_slash(props.route, 'start', false)}.component`)
235
250
 
236
251
  // 如果有组件标识
237
- } else if (props.name && $n.has(components, props.name)) {
252
+ } else if (props.name && $n_has(components, props.name)) {
238
253
  // 获取自定义组件
239
254
  comp = components[props.name]
240
255
  }
@@ -245,7 +260,7 @@ export default {
245
260
  }
246
261
 
247
262
  // 如果是方法, 则说明是异步组件
248
- if ($n.isFunction(comp)) {
263
+ if ($n_isFunction(comp)) {
249
264
  return defineAsyncComponent(comp)
250
265
  }
251
266
 
@@ -265,7 +280,7 @@ export default {
265
280
 
266
281
  return props.route ?
267
282
  // 如果是路由路径, 则获取路由标题
268
- $n.get(routers, `${$n.slash(props.route, 'start', false)}.meta.title`, '')
283
+ $n_get(routers, `${$n_slash(props.route, 'start', false)}.meta.title`, '')
269
284
  : ''
270
285
  })
271
286
 
@@ -285,17 +300,17 @@ export default {
285
300
  async function onDialogConfirm() {
286
301
 
287
302
  // 如果有确定按钮
288
- if ($n.isFunction(props.onConfirm)) {
303
+ if ($n_isFunction(props.onConfirm)) {
289
304
 
290
- if (! $n.isFunction(compSubmit)) {
305
+ if (! $n_isFunction(compSubmit)) {
291
306
  // 轻提示
292
- $n.toast({
307
+ $n_toast({
293
308
  message: '未调用 $dialog.submit 方法',
294
309
  })
295
310
  return
296
311
  }
297
312
 
298
- const res = await $n.runAsync(props.onConfirm)(await $n.runAsync(compSubmit)(), hide)
313
+ const res = await $n_runAsync(props.onConfirm)(await $n_runAsync(compSubmit)(), hide)
299
314
  if (res === false) {
300
315
  return
301
316
  }
@@ -330,7 +345,6 @@ export default {
330
345
  </script>
331
346
 
332
347
  <style lang="scss">
333
-
334
348
  .n-dialog-proxy {
335
349
 
336
350
  &--fullscreen {
@@ -5,6 +5,8 @@
5
5
  </template>
6
6
 
7
7
  <script>
8
+ import $n_dialog from '../../utils/dialog'
9
+
8
10
  export default {
9
11
 
10
12
  /**
@@ -43,7 +45,7 @@ export default {
43
45
  /**
44
46
  * 组合式
45
47
  */
46
- setup(props, { emit }) {
48
+ setup(props) {
47
49
 
48
50
  // ==========【方法】=============================================================================================
49
51
 
@@ -53,7 +55,7 @@ export default {
53
55
  function onDialog() {
54
56
 
55
57
  // 创建对话框
56
- $n.dialog.create({
58
+ $n_dialog.create({
57
59
  // 标题
58
60
  title: props.title,
59
61
  // 宽
@@ -17,6 +17,7 @@
17
17
 
18
18
  <script>
19
19
  import { ref, computed } from 'vue'
20
+ import $n_isValidArray from '@netang/utils/isValidArray'
20
21
 
21
22
  export default {
22
23
 
@@ -68,7 +69,7 @@ export default {
68
69
  */
69
70
  const isDrag = computed(function() {
70
71
  return props.drag
71
- && $n.isValidArray(props.modelValue)
72
+ && $n_isValidArray(props.modelValue)
72
73
  && props.modelValue.length > 1
73
74
  })
74
75
 
@@ -101,7 +102,7 @@ export default {
101
102
  if (isDrag.value) {
102
103
 
103
104
  // 如果为火狐浏览器, 则必须要setData
104
- // if ($n.ua.firefox) {
105
+ // if ($n_ua.firefox) {
105
106
  // e.dataTransfer.setData('info', e.target.id)
106
107
  // }
107
108
 
@@ -23,6 +23,15 @@
23
23
  import { ref, inject, nextTick, watch } from 'vue'
24
24
  import { useQuasar } from 'quasar'
25
25
 
26
+ import $n_isNil from 'lodash/isNil'
27
+
28
+ import $n_router from '@netang/vue-utils/router'
29
+
30
+ import $n_storage from '@netang/utils/storage'
31
+ import $n_sleep from '@netang/utils/sleep'
32
+ import $n_percentValue from '@netang/utils/percentValue'
33
+ import $n_pxValue from '@netang/utils/pxValue'
34
+
26
35
  import { layoutKey, emptyRenderFn } from 'quasar/src/utils/private/symbols.js'
27
36
 
28
37
  import { NPowerKey } from '../../utils/symbols'
@@ -126,7 +135,7 @@ export default {
126
135
  }
127
136
 
128
137
  // 创建睡眠实例
129
- const sleep = $n.sleep()
138
+ const sleep = $n_sleep()
130
139
 
131
140
  // 缓存名
132
141
  let cacheName = ''
@@ -138,10 +147,10 @@ export default {
138
147
  if ($q.platform.is.mobile) {
139
148
 
140
149
  // 获取手机端百分比值
141
- let res = $n.percentValue(props.mobileWidth, true)
150
+ let res = $n_percentValue(props.mobileWidth, true)
142
151
 
143
152
  // 如果是百分比值
144
- if (! $n.isNil(res)) {
153
+ if (! $n_isNil(res)) {
145
154
  // 原始尺寸 = 屏幕宽度 * 百分比
146
155
  if (res) {
147
156
  originalWidth = $q.screen.width * res
@@ -149,7 +158,7 @@ export default {
149
158
 
150
159
  } else {
151
160
  // 原始尺寸 = 屏幕宽度像素
152
- res = $n.pxValue(props.mobileWidth)
161
+ res = $n_pxValue(props.mobileWidth)
153
162
  if (res) {
154
163
  originalWidth = res
155
164
  }
@@ -159,10 +168,10 @@ export default {
159
168
  } else if (props.drag && props.cache) {
160
169
 
161
170
  // 设置缓存名
162
- cacheName = `drawer:${props.side}:${props.cache === true ? ($power && $power.routePath ? $power.routePath : $n.router.getRoute('path')) : props.cache}`
171
+ cacheName = `drawer:${props.side}:${props.cache === true ? ($power && $power.routePath ? $power.routePath : $n_router.getRoute('path')) : props.cache}`
163
172
 
164
173
  // 从缓存获取宽度
165
- const cache = $n.storage.get(cacheName)
174
+ const cache = $n_storage.get(cacheName)
166
175
  if (cache) {
167
176
  originalWidth = cache
168
177
  }
@@ -247,7 +256,7 @@ export default {
247
256
  sleep(500)
248
257
  .then(function () {
249
258
  // 设置缓存(永久缓存)
250
- $n.storage.set(cacheName, newWidth, 0)
259
+ $n_storage.set(cacheName, newWidth, 0)
251
260
  })
252
261
  }
253
262
  }
@@ -268,8 +277,6 @@ export default {
268
277
  </script>
269
278
 
270
279
  <style lang="scss" scoped>
271
- @import "@/assets/sass/var.scss";
272
-
273
280
  .n-drawer {
274
281
  // 拖拽手柄
275
282
  &__drag-handle {
@@ -10,6 +10,13 @@
10
10
  import { ref, watch, computed, onMounted } from 'vue'
11
11
 
12
12
  import script from '@netang/utils/script'
13
+ import $n_isNumeric from '@netang/utils/isNumeric'
14
+ import $n_isValidValue from '@netang/utils/isValidValue'
15
+ import $n_sleep from '@netang/utils/sleep'
16
+ import $n_px from '@netang/utils/px'
17
+
18
+
19
+ import $n_toast from '../../utils/toast'
13
20
 
14
21
  export default {
15
22
 
@@ -71,8 +78,8 @@ export default {
71
78
  */
72
79
  const currentStyle = computed(function () {
73
80
  return {
74
- width: $n.isNumeric(props.width) ? $n.px(props.width) : props.width,
75
- height: $n.isNumeric(props.height) ? $n.px(props.height) : props.height,
81
+ width: $n_isNumeric(props.width) ? $n_px(props.width) : props.width,
82
+ height: $n_isNumeric(props.height) ? $n_px(props.height) : props.height,
76
83
  }
77
84
  })
78
85
 
@@ -88,7 +95,7 @@ export default {
88
95
  let stopValueWatcher = false
89
96
 
90
97
  // 创建睡眠实例
91
- const sleep = $n.sleep()
98
+ const sleep = $n_sleep()
92
99
 
93
100
  // ==========【监听数据】=========================================================================================
94
101
 
@@ -238,14 +245,14 @@ export default {
238
245
  // 如果语言为 json
239
246
  if (
240
247
  props.language === 'json'
241
- && $n.isValidValue(value)
248
+ && $n_isValidValue(value)
242
249
  ) {
243
250
  try {
244
251
  value = JSON.stringify(JSON.parse(value))
245
252
 
246
253
  } catch (e) {
247
254
  // 轻提示
248
- $n.toast({
255
+ $n_toast({
249
256
  message: 'JSON 语法错误'
250
257
  })
251
258
  return
@@ -5,7 +5,7 @@
5
5
  <q-icon
6
6
  :name="icon"
7
7
  color="grey-5"
8
- :size="$n.px(iconSize)"
8
+ :size="toPx(iconSize)"
9
9
  />
10
10
 
11
11
  <!-- 描述文字 -->
@@ -14,6 +14,8 @@
14
14
  </template>
15
15
 
16
16
  <script>
17
+ import $n_px from '@netang/utils/px'
18
+
17
19
  export default {
18
20
 
19
21
  /**
@@ -38,5 +40,18 @@ export default {
38
40
  // 描述文字
39
41
  description: String,
40
42
  },
43
+
44
+ /**
45
+ * 组合式
46
+ */
47
+ setup() {
48
+
49
+ // ==========【方法】=============================================================================================
50
+
51
+ return {
52
+ // 转像素
53
+ toPx: $n_px,
54
+ }
55
+ }
41
56
  }
42
57
  </script>