view-ui-plus-derive 0.2.0 → 0.2.2
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.
- package/README.md +46 -12
- package/dist/index.d.ts +73 -477
- package/dist/index.js +686 -645
- package/dist/iview-mod.js +1 -0
- package/dist/iview-mods/index.d.ts +4 -0
- package/dist/iview-mods/table-cache-cols.js +50 -0
- package/dist/umd/en-US.js +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/iview-mod.js +1 -1
- package/dist/umd/zh-CN.js +1 -1
- package/package.json +20 -16
package/README.md
CHANGED
|
@@ -13,8 +13,6 @@ or
|
|
|
13
13
|
yarn add view-ui-plus-derive
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
[TOC]
|
|
17
|
-
|
|
18
16
|
### CDN引入
|
|
19
17
|
|
|
20
18
|
```html
|
|
@@ -99,7 +97,7 @@ createApp(App).use(ViewUIPlus).component(Combi.name, Combi).mount('#app')
|
|
|
99
97
|
仅部分组件需要对应样式,如图
|
|
100
98
|

|
|
101
99
|
|
|
102
|
-
|
|
100
|
+
## 国际化
|
|
103
101
|
|
|
104
102
|
目前提供中英翻译,默认显示简体中文。在安装插件时可传入需要显示的语言,若使用vue-i18n,则只需传入vue-i18n实例
|
|
105
103
|
|
|
@@ -228,7 +226,7 @@ createApp(App)
|
|
|
228
226
|
.mount('#app')
|
|
229
227
|
```
|
|
230
228
|
|
|
231
|
-
|
|
229
|
+
## 调优
|
|
232
230
|
|
|
233
231
|
- 为多选模式的iview Select添加全选功能。**若全局安装了插件则无需再次注册指令**
|
|
234
232
|
|
|
@@ -251,26 +249,62 @@ import { iviewSelect as vIviewSelect } from "view-ui-plus-derive";
|
|
|
251
249
|
<Select v-iview-select:all="true" multiple></Select>
|
|
252
250
|
```
|
|
253
251
|
|
|
254
|
-
- 调整iview的InputNumber默认值为null,避免在值为undefined时显示 1
|
|
255
|
-
- 为InputNumber添加prop
|
|
252
|
+
- 调整iview的 InputNumber 默认值为null,避免在值为undefined时显示 1
|
|
253
|
+
- 为 InputNumber 添加prop:`unset`,用于设置在清空时的默认值
|
|
256
254
|
|
|
257
255
|
```js
|
|
258
256
|
import 'view-ui-plus-derive/iview-mods/input-number'
|
|
259
257
|
```
|
|
260
258
|
|
|
261
|
-
- 修复iview Select启用filterable时在过滤后可能只显示之前所选项的bug
|
|
259
|
+
- 修复 iview Select 启用filterable时在过滤后可能只显示之前所选项的bug
|
|
262
260
|
|
|
263
261
|
```js
|
|
264
262
|
import 'view-ui-plus-derive/iview-mods/select'
|
|
265
263
|
```
|
|
266
264
|
|
|
267
|
-
- 修复Table在某些情况下表头/固定列与内容错位
|
|
265
|
+
- 修复 Table 在某些情况下表头/固定列与内容错位
|
|
268
266
|
|
|
269
267
|
```js
|
|
270
268
|
import 'view-ui-plus-derive/iview-mods/table'
|
|
271
269
|
```
|
|
272
270
|
|
|
273
|
-
|
|
271
|
+
- 为 Table 添加prop:`cache-cols`,启用列宽缓存功能
|
|
272
|
+
|
|
273
|
+
```js
|
|
274
|
+
import 'view-ui-plus-derive/iview-mods/table-cache-cols'
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
```vue
|
|
278
|
+
<template>
|
|
279
|
+
<Table border :columns="columns" :cache-cols="cacheCols"></Table>
|
|
280
|
+
</template>
|
|
281
|
+
|
|
282
|
+
<script setup>
|
|
283
|
+
const columns = [
|
|
284
|
+
{
|
|
285
|
+
prop: 'name',
|
|
286
|
+
label: '名称',
|
|
287
|
+
resizable: true
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
prop: 'age',
|
|
291
|
+
label: '年龄'
|
|
292
|
+
}
|
|
293
|
+
]
|
|
294
|
+
// 传递字符串指定存储路径
|
|
295
|
+
const cacheCols = 'app.userA.[page.list.cols]'
|
|
296
|
+
|
|
297
|
+
// 也可传递一个对象:keys 决定存储路径,cols 为列配置
|
|
298
|
+
const cacheCols = {
|
|
299
|
+
// 若路径较深,建议适当扁平以简化存取的对象结构
|
|
300
|
+
// 如下会以 app.userA['page.list.cols'] 的形式读写 localStorage。若去掉中括号,对象将为 app.userA.page.list.cols 的形式
|
|
301
|
+
keys: 'app.userA.[page.list.cols]', // 或者不使用点,如 'app.userA.page_list_cols' | 'app.userA.page-list-cols'
|
|
302
|
+
cols: columns
|
|
303
|
+
}
|
|
304
|
+
</script>
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
也可以一次性引入iview-mods下的所有mod:input-number、select、table、cache-cols等
|
|
274
308
|
|
|
275
309
|
```js
|
|
276
310
|
// 本地引入
|
|
@@ -298,7 +332,7 @@ import 'view-ui-plus-derive/iview-mod.css'
|
|
|
298
332
|
<link rel="stylesheet" href="https://unpkg.com/view-ui-plus-derive/dist/iview-mod.css" />
|
|
299
333
|
```
|
|
300
334
|
|
|
301
|
-
|
|
335
|
+
## 组件
|
|
302
336
|
|
|
303
337
|
[AllCheckbox](./md/AllCheckbox.md)
|
|
304
338
|
提供全选功能的CheckboxGroup
|
|
@@ -307,13 +341,13 @@ import 'view-ui-plus-derive/iview-mod.css'
|
|
|
307
341
|
更易于使用的Switch
|
|
308
342
|
|
|
309
343
|
[RemoteSelect](./md/RemoteSelect.md)
|
|
310
|
-
|
|
344
|
+
获取远程数据的Select,默认在展开时才触发请求
|
|
311
345
|
|
|
312
346
|
[CacheSelect](./md/CacheSelect.md)
|
|
313
347
|
避免重复调用远程接口的RemoteSelect,同一个cacheId对应只触发一次请求
|
|
314
348
|
|
|
315
349
|
[Combi](./md/Combi.md)
|
|
316
|
-
类似iview Input[append prepend]
|
|
350
|
+
类似iview Input[append prepend]样式的组合框
|
|
317
351
|
|
|
318
352
|
[CountRange](./md/CountRange.md)
|
|
319
353
|
数值范围组件
|