vue-lazy-cascader 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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 JYJ
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2024 JYJ
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,50 +1,70 @@
1
- # Vue Lazy Cascader
2
-
3
- Vue Lazy Cascader 是一个vue2级联选择器组件,基于 element-ui 的级联组件。它保留了 el-cascader 的完整功能,并增加了滚动加载和远程搜索功能。
4
-
5
- ## Install
6
-
7
- 您可以通过 npm、yarn 或 pnpm 来安装 Vue Lazy Cascader。
8
-
9
- ### npm
10
-
11
- ```bash
12
- npm install vue-lazy-cascader --save
13
- ```
14
-
15
- ### yarn
16
-
17
- ```bash
18
- yarn add vue-lazy-cascader
19
- ```
20
-
21
- ### pnpm
22
-
23
- ```bash
24
- pnpm install vue-lazy-cascader --save
25
- ```
26
-
27
- ## Changelog
28
- [更新日志](./CHANGELOG.md)
29
-
30
- ## Usage
31
-
32
- - es模块示例
33
- - [代码](./src/components/VueLazyCascaderExample.vue)
34
-
35
- - [demo](https://jyj1202.github.io/vue-lazy-cascader/)
36
-
37
- ```javascript
38
- import VueLazyCascader from "vue-lazy-cascader";
39
- ```
40
-
41
-
42
- - 直接script引入示例
43
- - [代码](./public/vue-lazy-cascader.html)
44
-
45
- - [demo](https://jyj1202.github.io/vue-lazy-cascader/vue-lazy-cascader.html)
46
-
47
- ## Tip
48
- - 由于该组件并未打包element-ui相关组件,所以使用时,必须已经安装element-ui。
49
- - 级联value必须唯一,否则会出错。例如相同value的子节点无法插入到不同的父节点下(待修复)
50
- - 是否是最后一页要判断准确,不能单纯用已加载和接口返回相加数量 == total进行判断,因为接口返回的可能已经加载过了。[详情请看代码(搜索时候会把搜索结果append到节点store中)](./src/components/cascader/src/cascader.vue)
1
+ # Vue Lazy Cascader
2
+
3
+ Vue Lazy Cascader 是一个vue2级联选择器组件,基于 element-ui 的级联组件。它保留了 el-cascader 的完整功能,并增加了滚动加载和远程搜索功能。
4
+
5
+ ## Install
6
+
7
+ 您可以通过 npm、yarn 或 pnpm 来安装 Vue Lazy Cascader。
8
+
9
+ ### npm
10
+
11
+ ```bash
12
+ npm install vue-lazy-cascader --save
13
+ ```
14
+
15
+ ### yarn
16
+
17
+ ```bash
18
+ yarn add vue-lazy-cascader
19
+ ```
20
+
21
+ ### pnpm
22
+
23
+ ```bash
24
+ pnpm install vue-lazy-cascader --save
25
+ ```
26
+
27
+ ## Changelog
28
+ [更新日志](./CHANGELOG.md)
29
+
30
+ ## Usage
31
+
32
+ - es模块示例
33
+ - [代码](./src/components/VueLazyCascaderExample.vue)
34
+
35
+ - [demo](https://jyj1202.github.io/vue-lazy-cascader/)
36
+
37
+ ```javascript
38
+ import VueLazyCascader from "vue-lazy-cascader";
39
+ ```
40
+
41
+
42
+ - 直接script引入示例
43
+ - [代码](./public/vue-lazy-cascader.html)
44
+
45
+ - [demo](https://jyj1202.github.io/vue-lazy-cascader/vue-lazy-cascader.html)
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
+
66
+ ## Tip
67
+ - 该组件打包了所需的element-ui组件,但是并没有引入element-ui样式,所以在使用前必须引入'element-ui/lib/theme-chalk/index.css'
68
+ - 级联value必须唯一,否则会出错。例如相同value的子节点无法插入到不同的父节点下(待修复)
69
+ - 是否是最后一页要判断准确,不能单纯用已加载和接口返回相加数量 == total进行判断,因为接口返回的可能已经加载过了。[详情请看代码(搜索时候会把搜索结果append到节点store中)](./src/components/cascader/src/cascader.vue)
70
+ - pop的层级如果不对,可以将appendToBody设置为false