vue-lazy-cascader 0.2.0 → 0.2.1
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 +21 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -44,7 +44,27 @@ pnpm install vue-lazy-cascader --save
|
|
|
44
44
|
|
|
45
45
|
- [demo](https://jyj1202.github.io/vue-lazy-cascader/vue-lazy-cascader.html)
|
|
46
46
|
|
|
47
|
+
## description
|
|
48
|
+
|
|
49
|
+
### Added Prop
|
|
50
|
+
|
|
51
|
+
| 属性名 | 类型 | 描述 |
|
|
52
|
+
|----------------|-----------|--------------------|
|
|
53
|
+
| remote | boolean | 是否开启远程搜索 |
|
|
54
|
+
| props.remoteMethod | (query: string, resolve: (any[]) => void) | 远程搜索方法,回调接收搜索的数据作为参数,会将未加载的数据插入到级联的数据store中 |
|
|
55
|
+
| props.total | string | 指定选项子节点总数为选项对象的某个属性值,默认'total' |
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
### Added Events
|
|
59
|
+
|
|
60
|
+
| event name | callback parameter | description |
|
|
61
|
+
|------------------|------------------------------|--------------------------------|
|
|
62
|
+
| menu-scroll-bottom | (parentNode: Node, resolve: (any[]) => void) | 当菜单滚动到底部时触发,回调接收滚动加载的新数据作为参数,会将传入的未加载的数据插入到级联的数据store中。 |
|
|
63
|
+
| suggestion-scroll-bottom | (query: string, resolve: (any[]) => void) | 当搜索列表滚动到底部时触发,回调接收搜索的数据作为参数,会将未加载的数据插入到级联的数据store中。 |
|
|
64
|
+
|
|
65
|
+
|
|
47
66
|
## Tip
|
|
48
|
-
-
|
|
67
|
+
- 该组件打包了所需的element-ui组件,但是并没有引入element-ui样式,所以在使用前必须引入'element-ui/lib/theme-chalk/index.css'
|
|
49
68
|
- 级联value必须唯一,否则会出错。例如相同value的子节点无法插入到不同的父节点下(待修复)
|
|
50
69
|
- 是否是最后一页要判断准确,不能单纯用已加载和接口返回相加数量 == total进行判断,因为接口返回的可能已经加载过了。[详情请看代码(搜索时候会把搜索结果append到节点store中)](./src/components/cascader/src/cascader.vue)
|
|
70
|
+
- pop的层级如果不对,可以将appendToBody设置为false
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-lazy-cascader",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A cascader component based on element-ui, which retains the basic functionality of el-cascader while adding remote search and scroll loading of nodes.",
|
|
6
|
-
"main": "./dist/lib/vue-lazy-cascader.
|
|
6
|
+
"main": "./dist/lib/vue-lazy-cascader.common.js",
|
|
7
|
+
"browser": "./dist/lib/vue-lazy-cascader.umd.min.js",
|
|
7
8
|
"files": [
|
|
8
9
|
"dist/lib",
|
|
9
10
|
"README.md",
|