-
+
+
{{ value }}
@@ -20,26 +21,11 @@ export default {
data() {
return {
options: [
- {
- obj: { val: '选项1', id: 1 },
- text: '黄金糕'
- },
- {
- obj: { val: '选项2', id: 2 },
- text: '双皮奶'
- },
- {
- obj: { val: '选项3', id: 3 },
- text: '蚵仔煎'
- },
- {
- obj: { val: '选项4', id: 4 },
- text: '龙须面'
- },
- {
- obj: { val: '选项5', id: 5 },
- text: '北京烤鸭'
- }
+ { obj: { val: '选项1', id: 1 }, text: '黄金糕' },
+ { obj: { val: '选项2', id: 2 }, text: '双皮奶' },
+ { obj: { val: '选项3', id: 3 }, text: '蚵仔煎' },
+ { obj: { val: '选项4', id: 4 }, text: '龙须面' },
+ { obj: { val: '选项5', id: 5 }, text: '北京烤鸭' }
],
value: { val: '选项3', id: 3 }
}
diff --git a/examples/docs/resources/pc/demo/select/cache-usage.vue b/examples/docs/resources/pc/demo/select/cache-usage.vue
index 2ba9ce522..a5750bfee 100644
--- a/examples/docs/resources/pc/demo/select/cache-usage.vue
+++ b/examples/docs/resources/pc/demo/select/cache-usage.vue
@@ -1,13 +1,7 @@
-
+
{{ cacheValue }}
@@ -28,26 +22,11 @@ export default {
},
cacheValue: '',
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: '选项3'
}
diff --git a/examples/docs/resources/pc/demo/select/clearable.vue b/examples/docs/resources/pc/demo/select/clearable.vue
index f8a14a522..f7788f756 100644
--- a/examples/docs/resources/pc/demo/select/clearable.vue
+++ b/examples/docs/resources/pc/demo/select/clearable.vue
@@ -1,6 +1,7 @@
-
+
+
@@ -15,26 +16,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: '选项3'
}
diff --git a/examples/docs/resources/pc/demo/select/collapse-tags.vue b/examples/docs/resources/pc/demo/select/collapse-tags.vue
index 0ad4de68e..cd0d082de 100644
--- a/examples/docs/resources/pc/demo/select/collapse-tags.vue
+++ b/examples/docs/resources/pc/demo/select/collapse-tags.vue
@@ -1,6 +1,7 @@
-
+
+
@@ -15,26 +16,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ['选项1', '选项2']
}
diff --git a/examples/docs/resources/pc/demo/select/custom-options.vue b/examples/docs/resources/pc/demo/select/custom-options.vue
index 0175c086a..45a9d5267 100644
--- a/examples/docs/resources/pc/demo/select/custom-options.vue
+++ b/examples/docs/resources/pc/demo/select/custom-options.vue
@@ -20,26 +20,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/custom-prefix.vue b/examples/docs/resources/pc/demo/select/custom-prefix.vue
index 597ae24f6..bfe790a86 100644
--- a/examples/docs/resources/pc/demo/select/custom-prefix.vue
+++ b/examples/docs/resources/pc/demo/select/custom-prefix.vue
@@ -3,7 +3,8 @@
-
+
+
@@ -20,26 +21,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/custom-reference-slot.vue b/examples/docs/resources/pc/demo/select/custom-reference-slot.vue
index 81f8eeb9c..1a2140aac 100644
--- a/examples/docs/resources/pc/demo/select/custom-reference-slot.vue
+++ b/examples/docs/resources/pc/demo/select/custom-reference-slot.vue
@@ -3,7 +3,8 @@
-
+
+
@@ -20,26 +21,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/disabled-and-selected-options.vue b/examples/docs/resources/pc/demo/select/disabled-and-selected-options.vue
index 3f297c687..87bb2cbfd 100644
--- a/examples/docs/resources/pc/demo/select/disabled-and-selected-options.vue
+++ b/examples/docs/resources/pc/demo/select/disabled-and-selected-options.vue
@@ -1,6 +1,8 @@
-
+
+
@@ -15,27 +17,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕',
- disabled: true
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ['选项1']
}
diff --git a/examples/docs/resources/pc/demo/select/disabled-options.vue b/examples/docs/resources/pc/demo/select/disabled-options.vue
index 5b8eee74e..28320e87e 100644
--- a/examples/docs/resources/pc/demo/select/disabled-options.vue
+++ b/examples/docs/resources/pc/demo/select/disabled-options.vue
@@ -1,6 +1,8 @@
-
+
+
@@ -15,28 +17,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕',
- disabled: true
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎',
- disabled: true
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: []
}
diff --git a/examples/docs/resources/pc/demo/select/disabled.vue b/examples/docs/resources/pc/demo/select/disabled.vue
index 7cfb9ead5..56095143f 100644
--- a/examples/docs/resources/pc/demo/select/disabled.vue
+++ b/examples/docs/resources/pc/demo/select/disabled.vue
@@ -1,6 +1,7 @@
-
+
+
@@ -15,26 +16,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/envts-change.vue b/examples/docs/resources/pc/demo/select/envts-change.vue
index 46e073c5e..b50547f01 100644
--- a/examples/docs/resources/pc/demo/select/envts-change.vue
+++ b/examples/docs/resources/pc/demo/select/envts-change.vue
@@ -1,6 +1,7 @@
-
+
+
@@ -15,26 +16,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/envts-remove.vue b/examples/docs/resources/pc/demo/select/envts-remove.vue
index ff0e09fdd..f4d848c54 100644
--- a/examples/docs/resources/pc/demo/select/envts-remove.vue
+++ b/examples/docs/resources/pc/demo/select/envts-remove.vue
@@ -1,6 +1,8 @@
-
-
+
+
+
@@ -15,26 +17,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/filter-method.vue b/examples/docs/resources/pc/demo/select/filter-method.vue
index 2d2ef3d90..d6f528a67 100644
--- a/examples/docs/resources/pc/demo/select/filter-method.vue
+++ b/examples/docs/resources/pc/demo/select/filter-method.vue
@@ -1,6 +1,7 @@
-
+
+
@@ -15,26 +16,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/hide-select-input-border.vue b/examples/docs/resources/pc/demo/select/hide-select-input-border.vue
index fd0518bb1..0680b36d1 100644
--- a/examples/docs/resources/pc/demo/select/hide-select-input-border.vue
+++ b/examples/docs/resources/pc/demo/select/hide-select-input-border.vue
@@ -1,6 +1,7 @@
-
+
+
@@ -15,26 +16,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/input-box-type.vue b/examples/docs/resources/pc/demo/select/input-box-type.vue
index 4478a8a8d..2fad9ad66 100644
--- a/examples/docs/resources/pc/demo/select/input-box-type.vue
+++ b/examples/docs/resources/pc/demo/select/input-box-type.vue
@@ -2,15 +2,18 @@
下划线默认
-
+
+
下划线禁用
-
+
+
下划线多选
-
+
+
@@ -26,26 +29,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value1: '',
value2: '',
diff --git a/examples/docs/resources/pc/demo/select/is-drop-inherit-width.vue b/examples/docs/resources/pc/demo/select/is-drop-inherit-width.vue
index 053c9dee4..8f3441089 100644
--- a/examples/docs/resources/pc/demo/select/is-drop-inherit-width.vue
+++ b/examples/docs/resources/pc/demo/select/is-drop-inherit-width.vue
@@ -2,11 +2,13 @@
未设置属性is-drop-inherit-width,下拉选项默认撑开:
-
+
+
设置了属性is-drop-inherit-width,下拉选项跟随输入框宽度:
-
+
+
@@ -22,27 +24,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label:
- '黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/manual-focus-blur.vue b/examples/docs/resources/pc/demo/select/manual-focus-blur.vue
index f21615237..8a5665d57 100644
--- a/examples/docs/resources/pc/demo/select/manual-focus-blur.vue
+++ b/examples/docs/resources/pc/demo/select/manual-focus-blur.vue
@@ -7,7 +7,8 @@
单击按钮 Select 将失去焦点
-
+
+
@@ -24,26 +25,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/memoize-usage.vue b/examples/docs/resources/pc/demo/select/memoize-usage.vue
index 624fb1916..6c42ed9dd 100644
--- a/examples/docs/resources/pc/demo/select/memoize-usage.vue
+++ b/examples/docs/resources/pc/demo/select/memoize-usage.vue
@@ -1,14 +1,8 @@
-
+
{{ cacheValue }}
@@ -23,26 +17,11 @@ import Memorize from '@opentiny/vue-renderless/common/deps/memorize'
const MemorizeInstance = new Memorize({ key: 'test456' })
const options = MemorizeInstance.assemble([
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
])
export default {
diff --git a/examples/docs/resources/pc/demo/select/multiple-limit.vue b/examples/docs/resources/pc/demo/select/multiple-limit.vue
index 5e3df6112..cc8721b43 100644
--- a/examples/docs/resources/pc/demo/select/multiple-limit.vue
+++ b/examples/docs/resources/pc/demo/select/multiple-limit.vue
@@ -1,6 +1,7 @@
-
+
+
@@ -15,26 +16,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/multiple.vue b/examples/docs/resources/pc/demo/select/multiple.vue
index bb43aa4c0..20dc3a0e3 100644
--- a/examples/docs/resources/pc/demo/select/multiple.vue
+++ b/examples/docs/resources/pc/demo/select/multiple.vue
@@ -1,6 +1,7 @@
-
+
+
@@ -15,34 +16,13 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- },
- {
- value: '选项6',
- label: '螺蛳粉'
- },
- {
- value: '选项7',
- label: '小龙虾'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' },
+ { value: '选项6', label: '螺蛳粉' },
+ { value: '选项7', label: '小龙虾' }
],
value: ['选项1', '选项2']
}
diff --git a/examples/docs/resources/pc/demo/select/name.vue b/examples/docs/resources/pc/demo/select/name.vue
index a66b2dd51..844077ee1 100644
--- a/examples/docs/resources/pc/demo/select/name.vue
+++ b/examples/docs/resources/pc/demo/select/name.vue
@@ -1,6 +1,7 @@
-
+
+
@@ -15,26 +16,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/no-match-text.vue b/examples/docs/resources/pc/demo/select/no-match-text.vue
index 7bf913b73..dee113346 100644
--- a/examples/docs/resources/pc/demo/select/no-match-text.vue
+++ b/examples/docs/resources/pc/demo/select/no-match-text.vue
@@ -1,6 +1,7 @@
-
+
+
@@ -15,26 +16,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/option-group-disable.vue b/examples/docs/resources/pc/demo/select/option-group-disable.vue
index 5c8f19e0b..98e216db1 100644
--- a/examples/docs/resources/pc/demo/select/option-group-disable.vue
+++ b/examples/docs/resources/pc/demo/select/option-group-disable.vue
@@ -22,35 +22,17 @@ export default {
label: '热门城市',
disabled: true,
options: [
- {
- value: 'Shanghai',
- label: '上海'
- },
- {
- value: 'Beijing',
- label: '北京'
- }
+ { value: 'Shanghai', label: '上海' },
+ { value: 'Beijing', label: '北京' }
]
},
{
label: '城市名',
options: [
- {
- value: 'Chengdu',
- label: '成都'
- },
- {
- value: 'Shenzhen',
- label: '深圳'
- },
- {
- value: 'Guangzhou',
- label: '广州'
- },
- {
- value: 'Dalian',
- label: '大连'
- }
+ { value: 'Chengdu', label: '成都' },
+ { value: 'Shenzhen', label: '深圳' },
+ { value: 'Guangzhou', label: '广州' },
+ { value: 'Dalian', label: '大连' }
]
}
],
diff --git a/examples/docs/resources/pc/demo/select/option-group.vue b/examples/docs/resources/pc/demo/select/option-group.vue
index 151ace72a..bcf157381 100644
--- a/examples/docs/resources/pc/demo/select/option-group.vue
+++ b/examples/docs/resources/pc/demo/select/option-group.vue
@@ -1,12 +1,7 @@
-
+
@@ -27,35 +22,17 @@ export default {
label: '热门城市',
disabled: true,
options: [
- {
- value: 'Shanghai',
- label: '上海'
- },
- {
- value: 'Beijing',
- label: '北京'
- }
+ { value: 'Shanghai', label: '上海' },
+ { value: 'Beijing', label: '北京' }
]
},
{
label: '城市名',
options: [
- {
- value: 'Chengdu',
- label: '成都'
- },
- {
- value: 'Shenzhen',
- label: '深圳'
- },
- {
- value: 'Guangzhou',
- label: '广州'
- },
- {
- value: 'Dalian',
- label: '大连'
- }
+ { value: 'Chengdu', label: '成都' },
+ { value: 'Shenzhen', label: '深圳' },
+ { value: 'Guangzhou', label: '广州' },
+ { value: 'Dalian', label: '大连' }
]
}
],
diff --git a/examples/docs/resources/pc/demo/select/popup-style-position.vue b/examples/docs/resources/pc/demo/select/popup-style-position.vue
index e3601ea02..707618e49 100644
--- a/examples/docs/resources/pc/demo/select/popup-style-position.vue
+++ b/examples/docs/resources/pc/demo/select/popup-style-position.vue
@@ -1,7 +1,9 @@
-
-
+
+
+
@@ -17,26 +19,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/search-allow-copy.vue b/examples/docs/resources/pc/demo/select/search-allow-copy.vue
index bc4a41e09..cc2403911 100644
--- a/examples/docs/resources/pc/demo/select/search-allow-copy.vue
+++ b/examples/docs/resources/pc/demo/select/search-allow-copy.vue
@@ -1,21 +1,8 @@
-
-
+
+
@@ -35,26 +22,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/searchable.vue b/examples/docs/resources/pc/demo/select/searchable.vue
index 9c2d397ce..c7e5ec3b5 100644
--- a/examples/docs/resources/pc/demo/select/searchable.vue
+++ b/examples/docs/resources/pc/demo/select/searchable.vue
@@ -2,11 +2,13 @@
@@ -22,26 +24,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: '',
multivalue: []
diff --git a/examples/docs/resources/pc/demo/select/set-input-value.vue b/examples/docs/resources/pc/demo/select/set-input-value.vue
index 229dbcd11..d5dd55479 100644
--- a/examples/docs/resources/pc/demo/select/set-input-value.vue
+++ b/examples/docs/resources/pc/demo/select/set-input-value.vue
@@ -1,8 +1,11 @@
- 设置value值
+
+ 设置value值
+
-
+
+
@@ -19,26 +22,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/show-alloption.vue b/examples/docs/resources/pc/demo/select/show-alloption.vue
index b93f82cf3..9983be0a4 100644
--- a/examples/docs/resources/pc/demo/select/show-alloption.vue
+++ b/examples/docs/resources/pc/demo/select/show-alloption.vue
@@ -1,6 +1,7 @@
-
+
+
@@ -15,26 +16,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/show-tip.vue b/examples/docs/resources/pc/demo/select/show-tip.vue
index e72cc1d03..68a897b94 100644
--- a/examples/docs/resources/pc/demo/select/show-tip.vue
+++ b/examples/docs/resources/pc/demo/select/show-tip.vue
@@ -1,6 +1,7 @@
-
+
+
@@ -15,26 +16,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/size-medium.vue b/examples/docs/resources/pc/demo/select/size-medium.vue
index 975226b1b..743b0e39b 100644
--- a/examples/docs/resources/pc/demo/select/size-medium.vue
+++ b/examples/docs/resources/pc/demo/select/size-medium.vue
@@ -12,26 +12,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/size-mini.vue b/examples/docs/resources/pc/demo/select/size-mini.vue
index e1c46a1e0..e50eed8aa 100644
--- a/examples/docs/resources/pc/demo/select/size-mini.vue
+++ b/examples/docs/resources/pc/demo/select/size-mini.vue
@@ -1,6 +1,7 @@
-
+
+
@@ -15,26 +16,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/size-small.vue b/examples/docs/resources/pc/demo/select/size-small.vue
index 9d8255535..eb046f1ee 100644
--- a/examples/docs/resources/pc/demo/select/size-small.vue
+++ b/examples/docs/resources/pc/demo/select/size-small.vue
@@ -1,6 +1,7 @@
-
+
+
@@ -15,26 +16,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/slot-default.vue b/examples/docs/resources/pc/demo/select/slot-default.vue
index c94c0ceb2..f7e394bae 100644
--- a/examples/docs/resources/pc/demo/select/slot-default.vue
+++ b/examples/docs/resources/pc/demo/select/slot-default.vue
@@ -18,26 +18,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/slot-footer.vue b/examples/docs/resources/pc/demo/select/slot-footer.vue
index a7b2cb5a2..3f5cdb9ec 100644
--- a/examples/docs/resources/pc/demo/select/slot-footer.vue
+++ b/examples/docs/resources/pc/demo/select/slot-footer.vue
@@ -1,9 +1,12 @@
-
+
+
@@ -21,26 +24,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ''
}
diff --git a/examples/docs/resources/pc/demo/select/tag-copy-all.vue b/examples/docs/resources/pc/demo/select/tag-copy-all.vue
index 08d6deb80..07615a110 100644
--- a/examples/docs/resources/pc/demo/select/tag-copy-all.vue
+++ b/examples/docs/resources/pc/demo/select/tag-copy-all.vue
@@ -1,13 +1,8 @@
-
+
复制到此处:
@@ -26,26 +21,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ['选项1']
}
diff --git a/examples/docs/resources/pc/demo/select/tag-select.vue b/examples/docs/resources/pc/demo/select/tag-select.vue
index c924d7ef5..476da182f 100644
--- a/examples/docs/resources/pc/demo/select/tag-select.vue
+++ b/examples/docs/resources/pc/demo/select/tag-select.vue
@@ -1,13 +1,8 @@
-
+
复制到此处:
@@ -26,26 +21,11 @@ export default {
data() {
return {
options: [
- {
- value: '选项1',
- label: '黄金糕'
- },
- {
- value: '选项2',
- label: '双皮奶'
- },
- {
- value: '选项3',
- label: '蚵仔煎'
- },
- {
- value: '选项4',
- label: '龙须面'
- },
- {
- value: '选项5',
- label: '北京烤鸭'
- }
+ { value: '选项1', label: '黄金糕' },
+ { value: '选项2', label: '双皮奶' },
+ { value: '选项3', label: '蚵仔煎' },
+ { value: '选项4', label: '龙须面' },
+ { value: '选项5', label: '北京烤鸭' }
],
value: ['选项1']
}
diff --git a/examples/docs/resources/pc/demo/select/tag-type.vue b/examples/docs/resources/pc/demo/select/tag-type.vue
new file mode 100644
index 000000000..b50b74967
--- /dev/null
+++ b/examples/docs/resources/pc/demo/select/tag-type.vue
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
diff --git a/examples/docs/resources/pc/demo/slide-bar/wheel-blocks.spec.ts b/examples/docs/resources/pc/demo/slide-bar/wheel-blocks.spec.ts
index 913754882..5daaa9d07 100644
--- a/examples/docs/resources/pc/demo/slide-bar/wheel-blocks.spec.ts
+++ b/examples/docs/resources/pc/demo/slide-bar/wheel-blocks.spec.ts
@@ -6,12 +6,13 @@ test('每次滚动块数', async ({ page }) => {
const preview = page.locator('#preview')
const slideBarContainer = preview.locator('.tiny-slide-bar__content')
const slideBarList = slideBarContainer.locator('.tiny-slide-bar__list')
+
await slideBarList.first().click()
await preview.locator('.icon-chevron-right').click()
// 单个滚动块的宽度固定为196px,所以应为 196px * 2
await expect(slideBarList).toHaveCSS('left', '-392px')
await preview.locator('.icon-chevron-right').click()
- await expect(slideBarList).toHaveCSS('left', '-976px')
+ await expect(slideBarList).toHaveCSS('left', '-784px')
await preview.locator('.icon-chevron-left').click()
- await expect(slideBarList).toHaveCSS('left', '0px')
+ await expect(slideBarList).toHaveCSS('left', '-392px')
})
diff --git a/examples/docs/resources/pc/demo/slider/basic-usage.spec.ts b/examples/docs/resources/pc/demo/slider/basic-usage.spec.ts
index c62c55fba..3823960e8 100644
--- a/examples/docs/resources/pc/demo/slider/basic-usage.spec.ts
+++ b/examples/docs/resources/pc/demo/slider/basic-usage.spec.ts
@@ -15,6 +15,6 @@ test('基础用法', async ({ page }) => {
// 滑块向右移动百分之二十
await page.mouse.move(sliderWidth * 0.2 + x, y)
const sliderTip = slider.locator('div').nth(2)
- await expect(sliderTip).toHaveText('39')
+ await expect(sliderTip).toHaveText('59')
await page.mouse.up()
})
diff --git a/examples/docs/resources/pc/demo/slider/range-select.spec.ts b/examples/docs/resources/pc/demo/slider/range-select.spec.ts
index 68eb89bfd..943debe1d 100644
--- a/examples/docs/resources/pc/demo/slider/range-select.spec.ts
+++ b/examples/docs/resources/pc/demo/slider/range-select.spec.ts
@@ -12,6 +12,7 @@ test('范围选择', async ({ page }) => {
const { x, y } = await sliderBlock1.boundingBox()
await sliderBlock1.hover()
+ await sliderBlock1.hover()
await page.mouse.down()
await page.mouse.move(sliderWidth * -0.1 + x, y)
const sliderTip = slider.locator('div').nth(3)
diff --git a/examples/docs/resources/pc/demo/steps/order-progress.vue b/examples/docs/resources/pc/demo/steps/order-progress.vue
index 4823e1ef4..1458b789e 100644
--- a/examples/docs/resources/pc/demo/steps/order-progress.vue
+++ b/examples/docs/resources/pc/demo/steps/order-progress.vue
@@ -2,9 +2,8 @@
{
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('http://localhost:7130/pc/steps/space')
+
+ const steps = page.locator('#preview .tiny-steps')
+ const node = steps.locator('li').first()
+ const { width } = await node.boundingBox()
+
+ await expect(Math.round(width)).toEqual(150)
+})
\ No newline at end of file
diff --git a/examples/docs/resources/pc/demo/steps/space.vue b/examples/docs/resources/pc/demo/steps/space.vue
new file mode 100644
index 000000000..27c573e15
--- /dev/null
+++ b/examples/docs/resources/pc/demo/steps/space.vue
@@ -0,0 +1,41 @@
+
+
+
+
+
diff --git a/examples/docs/resources/pc/demo/steps/text-position.vue b/examples/docs/resources/pc/demo/steps/text-position.vue
index 5bd083272..5144a9aa7 100644
--- a/examples/docs/resources/pc/demo/steps/text-position.vue
+++ b/examples/docs/resources/pc/demo/steps/text-position.vue
@@ -50,7 +50,7 @@ export default {
}
-
\ No newline at end of file
+
diff --git a/examples/docs/resources/pc/demo/time-line/set-step-width.vue b/examples/docs/resources/pc/demo/time-line/set-step-width.vue
index cf0a40c06..0f05224ed 100644
--- a/examples/docs/resources/pc/demo/time-line/set-step-width.vue
+++ b/examples/docs/resources/pc/demo/time-line/set-step-width.vue
@@ -1,5 +1,17 @@
-
+ 1. space
取值可以是带尺寸单位的具体数值。以下示例设置节点宽度为200px:
+
+
+ 2. space
取值也可以是百分比数值,基准为组件父元素的宽度。以下示例设置引导线长度为20%:
+
+
+
+
+
diff --git a/examples/docs/resources/pc/demo/time-select/clear-icon.spec.ts b/examples/docs/resources/pc/demo/time-select/clear-icon.spec.ts
index 0c3f52c00..dc12ffa83 100644
--- a/examples/docs/resources/pc/demo/time-select/clear-icon.spec.ts
+++ b/examples/docs/resources/pc/demo/time-select/clear-icon.spec.ts
@@ -8,6 +8,6 @@ test('自定义清空图标', async ({ page }) => {
await page.getByText('10:00').click()
await timeInput.hover()
// 点击图标,清除输入框内容
- await page.locator('i.tiny-input__icon svg').first().click()
+ await page.locator('#preview').getByRole('img').nth(1).click()
expect(await page.getByPlaceholder('选择时间').getAttribute('title')).toEqual('')
})
diff --git a/examples/docs/resources/pc/demo/time-select/suffix-icon.spec.ts b/examples/docs/resources/pc/demo/time-select/suffix-icon.spec.ts
index 0e7d881fe..97d452a3d 100644
--- a/examples/docs/resources/pc/demo/time-select/suffix-icon.spec.ts
+++ b/examples/docs/resources/pc/demo/time-select/suffix-icon.spec.ts
@@ -3,6 +3,6 @@ import { test, expect } from '@playwright/test'
test('后置图标', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('http://localhost:7130/pc/time-select/suffix-icon')
- const icon = page.locator('.tiny-input__icon svg')
+ const icon = page.locator('.tiny-input__icon-container svg')
await expect(icon).toHaveCount(1)
})
diff --git a/examples/docs/resources/pc/demo/toggle-menu/default-expand-all.spec.ts b/examples/docs/resources/pc/demo/toggle-menu/default-expand-all.spec.ts
index e246199f1..8fb3b6a27 100644
--- a/examples/docs/resources/pc/demo/toggle-menu/default-expand-all.spec.ts
+++ b/examples/docs/resources/pc/demo/toggle-menu/default-expand-all.spec.ts
@@ -1,13 +1,13 @@
-import { test, expect } from '@playwright/test';
+import { test, expect } from '@playwright/test'
test('默认展开所有节点', async ({ page }) => {
- page.on('pageerror', (exception) => expect(exception).toBeNull());
- await page.goto('http://localhost:7130/pc/toggle-menu/default-expand-all');
- const preview = page.locator('#preview');
- // 默认所有的节点都可见
- await expect(preview.locator('.tiny-tree .tiny-tree-node:visible')).toHaveCount(14);
- await page.getByTitle('开发指南').click();
- await expect(preview.locator('.tiny-tree .tiny-tree-node:visible')).toHaveCount(11);
- await page.getByRole('treeitem', { name: '表单组件 Button 按钮 Input 输入框' }).getByTitle('表单组件').click();
- await expect(preview.locator('.tiny-tree .tiny-tree-node:visible')).toHaveCount(9);
-})
\ No newline at end of file
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('http://localhost:7130/pc/toggle-menu/default-expand-all')
+ const preview = page.locator('#preview')
+ // 默认所有的节点都可见
+ await expect(preview.locator('.tiny-tree .tiny-tree-node:visible')).toHaveCount(14)
+ await page.getByTitle('开发指南').click()
+ await expect(preview.locator('.tiny-tree .tiny-tree-node:visible')).toHaveCount(11)
+ await page.getByTitle('表单组件').nth(1).click()
+ await expect(preview.locator('.tiny-tree .tiny-tree-node:visible')).toHaveCount(9)
+})
diff --git a/examples/docs/resources/pc/demo/toggle-menu/node-click.spec.ts b/examples/docs/resources/pc/demo/toggle-menu/node-click.spec.ts
index 37db2cf20..6aed5fe7a 100644
--- a/examples/docs/resources/pc/demo/toggle-menu/node-click.spec.ts
+++ b/examples/docs/resources/pc/demo/toggle-menu/node-click.spec.ts
@@ -1,13 +1,13 @@
-import { test, expect } from '@playwright/test';
+import { test, expect } from '@playwright/test'
test('点击节点事件', async ({ page }) => {
- page.on('pageerror', (exception) => expect(exception).toBeNull());
- await page.goto('http://localhost:7130/pc/toggle-menu/node-click');
- const preview = page.locator('#preview');
- await preview.getByRole('treeitem', { name: '更新日志' }).locator('div').nth(1).click();
- await expect(page.locator('.tiny-modal__box').filter({ hasText: '点击节点后的事件' })).toBeVisible();
- await preview.getByRole('treeitem', { name: '开发指南' }).locator('div').nth(1).click();
- await expect(page.locator('.tiny-modal__box').filter({ hasText: '点击节点后的事件' }).nth(1)).toBeVisible();
- await preview.getByRole('treeitem', { name: '开发指南 引入组件 国际化 权限' }).getByRole('treeitem', { name: '权限' }).locator('div').nth(1).click();
- await expect(page.locator('.tiny-modal__box').filter({ hasText: '点击节点后的事件' }).nth(2)).toBeVisible();
-})
\ No newline at end of file
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('http://localhost:7130/pc/toggle-menu/node-click')
+ const preview = page.locator('#preview')
+ await preview.getByRole('treeitem', { name: '更新日志' }).locator('div').nth(1).click()
+ await expect(page.locator('.tiny-modal__box').filter({ hasText: '点击节点后的事件' })).toBeVisible()
+ await preview.getByRole('treeitem', { name: '开发指南' }).locator('div').nth(1).click()
+ await expect(page.locator('.tiny-modal__box').filter({ hasText: '点击节点后的事件' }).nth(1)).toBeVisible()
+ await page.getByRole('treeitem', { name: '权限' }).locator('div').nth(1).click()
+ await expect(page.locator('.tiny-modal__box').filter({ hasText: '点击节点后的事件' }).nth(2)).toBeVisible()
+})
diff --git a/examples/docs/resources/pc/demo/transfer/nested-tree.spec.ts b/examples/docs/resources/pc/demo/transfer/nested-tree.spec.ts
index af89f31f3..4de5e67f4 100644
--- a/examples/docs/resources/pc/demo/transfer/nested-tree.spec.ts
+++ b/examples/docs/resources/pc/demo/transfer/nested-tree.spec.ts
@@ -1,27 +1,39 @@
-import { test, expect } from '@playwright/test';
+import { test, expect } from '@playwright/test'
test('判断是否可以将左侧数据交换至右侧面板', async ({ page }) => {
- page.on('pageerror', (exception) => expect(exception).toBeNull());
- await page.goto('http://localhost:7130/pc/transfer/nested-tree');
- const preview = page.locator('#preview');
- await preview.getByRole('treeitem', { name: '一级 1' }).locator('svg').first().click();
- await preview.getByRole('treeitem', { name: '一级 1 二级 1-1' }).locator('svg').nth(2).click();
- await preview.getByRole('treeitem', { name: '一级 1 二级 1-1 三级 1-1-1 三级 1-1-2' }).getByRole('treeitem', { name: '二级 1-1 三级 1-1-1 三级 1-1-2' }).getByRole('treeitem', { name: '三级 1-1-1' }).locator('span').nth(2).click();
- await preview.getByRole('button').first().click();
- const transferPanels = preview.locator('.tiny-transfer-panel');
- const rightPanel = transferPanels.nth(1);
- await expect(rightPanel.locator('div:nth-child(3) > div:nth-child(4) > .tiny-tree-node > .tiny-tree-node__content > span.tiny-tree-node__label')).toHaveText('三级 1-1-1');
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('http://localhost:7130/pc/transfer/nested-tree')
+ const preview = page.locator('#preview')
+ await preview.getByRole('treeitem', { name: '一级 1' }).locator('svg').first().click()
+ await preview.getByRole('treeitem', { name: '一级 1' }).getByText('二级 1-1').click()
+ await preview.getByRole('treeitem', { name: '三级 1-1-1' }).locator('span').nth(2).click()
+ await preview.getByRole('button').first().click()
+ const transferPanels = preview.locator('.tiny-transfer-panel')
+ const rightPanel = transferPanels.nth(1)
+ await expect(
+ rightPanel.locator(
+ 'div:nth-child(3) > div:nth-child(4) > .tiny-tree-node > .tiny-tree-node__content > span.tiny-tree-node__label'
+ )
+ ).toHaveText('三级 1-1-1')
})
test('置顶和置底功能', async ({ page }) => {
- page.on('pageerror', (exception) => expect(exception).toBeNull());
- await page.goto('http://localhost:7130/pc/transfer/nested-tree');
- const preview = page.locator('#preview');
- const buttons = await preview.getByRole('paragraph').filter({ hasText: '列表 2 1 / 3' }).locator('div');
- await buttons.nth(1).click();
- const transferPanels = preview.locator('.tiny-transfer-panel');
- const rightPanel = transferPanels.nth(1);
- await expect(rightPanel.locator('div:nth-child(3) > div:nth-child(1) > .tiny-tree-node > .tiny-tree-node__content > span.tiny-tree-node__label')).toHaveText('二级 2-1');
- await buttons.nth(2).click();
- await expect(rightPanel.locator('div:nth-child(3) > div:nth-child(3) > .tiny-tree-node > .tiny-tree-node__content > span.tiny-tree-node__label')).toHaveText('二级 2-1');
-})
\ No newline at end of file
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('http://localhost:7130/pc/transfer/nested-tree')
+ const preview = page.locator('#preview')
+ const buttons = await preview.getByRole('paragraph').filter({ hasText: '列表 2 1 / 3' }).locator('div')
+ await buttons.nth(1).click()
+ const transferPanels = preview.locator('.tiny-transfer-panel')
+ const rightPanel = transferPanels.nth(1)
+ await expect(
+ rightPanel.locator(
+ 'div:nth-child(3) > div:nth-child(1) > .tiny-tree-node > .tiny-tree-node__content > span.tiny-tree-node__label'
+ )
+ ).toHaveText('二级 2-1')
+ await buttons.nth(2).click()
+ await expect(
+ rightPanel.locator(
+ 'div:nth-child(3) > div:nth-child(3) > .tiny-tree-node > .tiny-tree-node__content > span.tiny-tree-node__label'
+ )
+ ).toHaveText('二级 2-1')
+})
diff --git a/examples/docs/resources/pc/demo/tree/slot-deffault.vue b/examples/docs/resources/pc/demo/tree/slot-deffault.vue
index 11ba8e7d0..6ec2d67de 100644
--- a/examples/docs/resources/pc/demo/tree/slot-deffault.vue
+++ b/examples/docs/resources/pc/demo/tree/slot-deffault.vue
@@ -1,7 +1,9 @@
- {{ sourceData.data.label }}
+
+ {{ sourceData.data.label }}
+
@@ -80,20 +82,18 @@ export default {
}
}
-
diff --git a/examples/docs/resources/pc/demo/user-account/custom-service.spec.ts b/examples/docs/resources/pc/demo/user-account/custom-service.spec.ts
new file mode 100644
index 000000000..994564faa
--- /dev/null
+++ b/examples/docs/resources/pc/demo/user-account/custom-service.spec.ts
@@ -0,0 +1,30 @@
+import { test, expect } from '@playwright/test'
+
+test('user-account-custom-service', async ({ page }) => {
+ await page.goto('http://localhost:7130/pc/user-account/custom-service')
+ const userImage = page.locator('.tiny-user-head__portrait')
+ const userName = page.locator('.tiny-user-contact__role-name')
+ const dropdown = page.locator('.tiny-popover.tiny-user-account')
+ const content = page.locator('.custom-content')
+ const loginButton = page.locator('.tiny-logout')
+
+ await expect(userImage).toHaveCSS('background-image', 'url("http://localhost:7130/static/images/dog1.png")')
+ await expect(userName).toHaveText('test1')
+ await expect(dropdown).toBeHidden()
+ await userName.hover()
+ await page.waitForTimeout(1000)
+ await expect(dropdown).toBeVisible()
+ await expect(content).toHaveText('默认插槽自定义内容')
+ await expect(loginButton).toHaveText('登录')
+ await loginButton.click()
+ await page.getByRole('button', { name: '确认' }).click()
+ await page.waitForTimeout(1000)
+ await userName.hover()
+ await page.waitForTimeout(1000)
+ await expect(loginButton).toHaveText('注销')
+ await loginButton.click()
+ await page.waitForTimeout(1000)
+ await userName.hover()
+ await page.waitForTimeout(1000)
+ await expect(loginButton).toHaveText('登录')
+})
diff --git a/examples/docs/resources/pc/demo/user-account/custom-service.vue b/examples/docs/resources/pc/demo/user-account/custom-service.vue
index fe74bd1a2..3edfa538f 100644
--- a/examples/docs/resources/pc/demo/user-account/custom-service.vue
+++ b/examples/docs/resources/pc/demo/user-account/custom-service.vue
@@ -1,9 +1,11 @@
-
+
+ 默认插槽自定义内容
+
diff --git a/examples/docs/resources/pc/demo/user-link/custom-service.spec.ts b/examples/docs/resources/pc/demo/user-link/custom-service.spec.ts
new file mode 100644
index 000000000..64ef9f033
--- /dev/null
+++ b/examples/docs/resources/pc/demo/user-link/custom-service.spec.ts
@@ -0,0 +1,21 @@
+import { test, expect } from '@playwright/test'
+
+test('user-link-custom-service', async ({ page }) => {
+ await page.goto('http://localhost:7130/pc/user-link/custom-service')
+ const card = page.locator('.tiny-popper.tiny-user-card')
+ const reference = page.locator('#preview .tiny-userlink .tiny-popover__reference')
+ const img = card.locator('.card-top-img img')
+
+ await expect(reference).toHaveText('test3')
+ await expect(card).toBeHidden()
+ await reference.click()
+ await page.waitForTimeout(1000)
+ await expect(card).toBeVisible()
+ await expect(img).toHaveAttribute('src', '/static/images/dog1.png')
+
+ const text = card.locator('.card-top-text')
+ await expect(text).toContainText(['公共技术测试数据部门(测试数据部)'])
+
+ await page.getByText('展开').click()
+ await page.getByText('收起').click()
+})
diff --git a/examples/docs/resources/pc/demo/user-link/custom-service.vue b/examples/docs/resources/pc/demo/user-link/custom-service.vue
index 78d27d5ed..77ddf86c6 100644
--- a/examples/docs/resources/pc/demo/user-link/custom-service.vue
+++ b/examples/docs/resources/pc/demo/user-link/custom-service.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/packages/vue/src/card-group/index.ts b/packages/vue/src/card-group/index.ts
index 177b2e614..93f333510 100644
--- a/packages/vue/src/card-group/index.ts
+++ b/packages/vue/src/card-group/index.ts
@@ -1,4 +1,5 @@
import CardGroup from './src/mobile-first.vue'
+import { version } from './package.json'
CardGroup.model = {
prop: 'modelValue',
@@ -10,7 +11,7 @@ CardGroup.install = function (Vue) {
Vue.component(CardGroup.name, CardGroup)
}
-CardGroup.version = process.env.COMPONENT_VERSION
+CardGroup.version = version
/* istanbul ignore next */
if (process.env.BUILD_TARGET === 'runtime') {
diff --git a/packages/vue/src/card-group/src/mobile-first.vue b/packages/vue/src/card-group/src/mobile-first.vue
index fec8eebff..52a4bd27a 100644
--- a/packages/vue/src/card-group/src/mobile-first.vue
+++ b/packages/vue/src/card-group/src/mobile-first.vue
@@ -43,13 +43,7 @@ export default defineComponent({
}
},
setup(props, context) {
- return setup({
- props,
- context,
- renderless,
- api,
- mono: true
- })
+ return setup({ props, context, renderless, api, mono: true })
}
})
diff --git a/packages/vue/src/card/index.ts b/packages/vue/src/card/index.ts
index 9f1af7b6e..547c9da10 100644
--- a/packages/vue/src/card/index.ts
+++ b/packages/vue/src/card/index.ts
@@ -1,4 +1,5 @@
import Card from './src/mobile-first.vue'
+import { version } from './package.json'
Card.model = {
prop: 'modelValue',
@@ -9,7 +10,7 @@ Card.install = function (Vue) {
Vue.component(Card.name, Card)
}
-Card.version = process.env.COMPONENT_VERSION
+Card.version = version
/* istanbul ignore next */
if (process.env.BUILD_TARGET === 'runtime') {
diff --git a/packages/vue/src/carousel-item/src/mobile-first.vue b/packages/vue/src/carousel-item/src/mobile-first.vue
index 6655e823d..8678392ca 100644
--- a/packages/vue/src/carousel-item/src/mobile-first.vue
+++ b/packages/vue/src/carousel-item/src/mobile-first.vue
@@ -1,17 +1,31 @@
-
-
+
+
-
+
{{
title
}}
diff --git a/packages/vue/src/carousel-item/src/pc.vue b/packages/vue/src/carousel-item/src/pc.vue
index e39b9c3c7..af311a1a6 100644
--- a/packages/vue/src/carousel-item/src/pc.vue
+++ b/packages/vue/src/carousel-item/src/pc.vue
@@ -10,15 +10,20 @@
*
-->
-
+
diff --git a/packages/vue/src/carousel/__tests__/carousel.test.tsx b/packages/vue/src/carousel/__tests__/carousel.test.tsx
new file mode 100644
index 000000000..4aa03b751
--- /dev/null
+++ b/packages/vue/src/carousel/__tests__/carousel.test.tsx
@@ -0,0 +1,101 @@
+import Carousel from '@opentiny/vue-carousel'
+import CarouselItem from '@opentiny/vue-carousel-item'
+import { describe, expect, test, vi } from 'vitest'
+import { mountPcMode } from '@opentiny-internal/vue-test-utils'
+
+describe('PC Mode', () => {
+ const mount = mountPcMode
+
+ const createCarouselItems = (count = 5, hasLabel = false) => {
+ const list = Array.from({ length: count }, (_, index) => index + 1)
+ return list.map((index) =>
+ hasLabel ?
{index} :
+ )
+ }
+
+ const _mount = (
+ props: any = {},
+ count?: number,
+ hasLabel?: boolean,
+ slot?: any
+ ) => {
+ return mount(() => (
+
+
+ {createCarouselItems(count, hasLabel)}
+ {slot || ''}
+
+
+ ), {
+ attachTo: 'body'
+ })
+ }
+
+ /**
+ * attrs
+ */
+ test('render & arrow', async () => {
+ const wrapper = _mount({
+ arrow: 'always'
+ })
+ const carousel = wrapper.findComponent({ name: 'TinyCarousel' })
+ expect(carousel.vm.arrow).toBe('always')
+ expect(wrapper.find('.tiny-carousel__arrow').isVisible()).toBeTruthy()
+ const items = wrapper.findAll('.tiny-carousel__item')
+ expect(items.length).toBe(5)
+ })
+
+ test.todo('autoplay 是否自动切换。默认为 false')
+
+ test.todo('height 走马灯的高度')
+
+ test.todo('indicator-position 指示器的位置。该属性的可选值为 outside / none')
+
+ test.todo('initial-index 初始状态激活的幻灯片的索引,从 0 开始。默认为 0')
+
+ test.todo('interval 自动切换的时间间隔,单位为毫秒。默认为 3000')
+
+ test.todo('show-title 是否显示标题。默认为 false')
+
+ test.todo('trigger 指示器的触发方式,默认为 hover。该属性的可选值为 click。默认为 hover')
+
+ test.todo('type 走马灯的类型;该属性的可选值为 horizontal / vertical / card。默认为 horizontal')
+
+ test.todo('loop 是否循环显示。默认为 true')
+
+ /**
+ * slots
+ */
+ test('default slot', async () => {
+ const wrapper = mount(() =>
自定义内容
)
+ const items = wrapper.find('.custom-content')
+ expect(items.text()).contain('自定义内容')
+ })
+
+ /**
+ * methods
+ */
+ test.todo('next 切换至下一张幻灯片')
+
+ test.todo('prev 切换至上一张幻灯片')
+
+ test.todo('setActiveItem 手动切换幻灯片')
+
+ /**
+ * events
+ */
+ test('change event', async () => {
+ const changeHandler = vi.fn()
+ const wrapper = _mount({
+ arrow: 'always',
+ onChange: changeHandler
+ })
+ const nextButton = wrapper.find('.tiny-carousel__arrow-right')
+ await nextButton.trigger('click')
+ expect(changeHandler).toBeCalled()
+
+ const preButton = wrapper.find('.tiny-carousel__arrow-left')
+ await preButton.trigger('click')
+ expect(changeHandler).toBeCalled()
+ })
+})
diff --git a/packages/vue/src/carousel/src/mobile-first.vue b/packages/vue/src/carousel/src/mobile-first.vue
index 1c5b806ef..e921d3284 100644
--- a/packages/vue/src/carousel/src/mobile-first.vue
+++ b/packages/vue/src/carousel/src/mobile-first.vue
@@ -1,81 +1,86 @@
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
{{ item.label }}
diff --git a/packages/vue/src/carousel/src/pc.vue b/packages/vue/src/carousel/src/pc.vue
index a9216cc31..25476f871 100644
--- a/packages/vue/src/carousel/src/pc.vue
+++ b/packages/vue/src/carousel/src/pc.vue
@@ -10,27 +10,57 @@
*
-->
-
+
-
+
-
+
-
-
+
+
{{ item.label }}
@@ -45,7 +75,19 @@ import { props, setup, defineComponent } from '@opentiny/vue-common'
import { iconChevronLeft, iconChevronRight } from '@opentiny/vue-icon'
export default defineComponent({
- props: [...props, 'initialIndex', 'height', 'trigger', 'autoplay', 'interval', 'indicatorPosition', 'arrow', 'type', 'showTitle', 'loop'],
+ props: [
+ ...props,
+ 'initialIndex',
+ 'height',
+ 'trigger',
+ 'autoplay',
+ 'interval',
+ 'indicatorPosition',
+ 'arrow',
+ 'type',
+ 'showTitle',
+ 'loop'
+ ],
setup(props, context) {
return setup({ props, context, renderless, api })
},
diff --git a/packages/vue/src/cascader-node/src/pc.vue b/packages/vue/src/cascader-node/src/pc.vue
index 939bf0c16..638dd86f5 100644
--- a/packages/vue/src/cascader-node/src/pc.vue
+++ b/packages/vue/src/cascader-node/src/pc.vue
@@ -15,7 +15,7 @@ import { $prefix, setup, h, defineComponent } from '@opentiny/vue-common'
import Checkbox from '@opentiny/vue-checkbox'
import Radio from '@opentiny/vue-radio'
import { isEqual } from '@opentiny/vue-renderless/common/object'
-import { iconLoading, iconChevronRight, iconYes } from '@opentiny/vue-icon'
+import { iconLoading, iconDeltaRight, iconYes } from '@opentiny/vue-icon'
export default defineComponent({
name: $prefix + 'CascaderNode',
@@ -24,7 +24,7 @@ export default defineComponent({
TinyRadio: Radio,
IconYes: iconYes(),
IconLoading: iconLoading(),
- IconChevronRight: iconChevronRight()
+ IconDeltaRight: iconDeltaRight()
},
inheritAttrs: false,
emits: ['expand', 'update:modelValue', 'expand-change', 'active-item-change', 'change'],
@@ -77,8 +77,7 @@ export default defineComponent({
indeterminate={node.indeterminate}
disabled={state.isDisabled}
onChange={this.handleMultiCheckChange}
- nativeOnClick={stopPropagation}
- >
+ nativeOnClick={stopPropagation}>
)
}
@@ -90,7 +89,12 @@ export default defineComponent({
}
return (
-
+
)
@@ -100,7 +104,7 @@ export default defineComponent({
const renderLoadingIcon = () =>
- const renderExpandIcon = () =>
+ const renderExpandIcon = () =>
const renderContent = () => {
const { panel, node } = this
diff --git a/packages/vue/src/cascader-panel/__tests__/cascader-panel.test.tsx b/packages/vue/src/cascader-panel/__tests__/cascader-panel.test.tsx
index 5ebc15c67..9c1fca218 100644
--- a/packages/vue/src/cascader-panel/__tests__/cascader-panel.test.tsx
+++ b/packages/vue/src/cascader-panel/__tests__/cascader-panel.test.tsx
@@ -116,4 +116,13 @@ describe('PC Mode', () => {
>)
expect(wrapper.find('.only-slot').exists()).toBe(true)
})
+
+ // 通过 expand-change 点击展开节点发生变化时触发,回调参数为 各父级选项值组成的数组
+ test.todo('expand-change')
+
+ // 可以通过 scoped slot 对级联面板的备选项的节点内容进行自定义,scoped slot 会传入两个字段 node 和 data,分别表示当前节点的 Node 对象和数据
+ test.todo('scoped slot')
+
+ // 通过 children 指定子级选项,默认值为 children。 通过 emitPath 是否返回由该节点所在的各级菜单的值所组成的数组。 通过 label 指定显示选项 label 值,默认为 label。 通过 value 指定值选项 value 值,默认为 value
+ test.todo('props')
})
diff --git a/packages/vue/src/cascader-select/src/mobile-first.vue b/packages/vue/src/cascader-select/src/mobile-first.vue
index 3ba9a646a..77b43f723 100644
--- a/packages/vue/src/cascader-select/src/mobile-first.vue
+++ b/packages/vue/src/cascader-select/src/mobile-first.vue
@@ -1,25 +1,48 @@
-
+
-
-
handleTouchend($event, i)" @touchmove.prevent="($event) => throttledHandleTouchmove($event, i)">
-
+
+
handleTouchend($event, i)"
+ @touchmove.prevent="($event) => throttledHandleTouchmove($event, i)"
+ >
+
{{ option[textField] }}
@@ -27,12 +50,20 @@
- {{ t('ui.button.confirm') }}
+
+ {{ t('ui.button.confirm') }}
+
@@ -63,7 +94,7 @@ export default defineComponent({
TinyButton: Button
},
setup(props, context): any {
- return setup({ props, context, renderless, api, mono: true })
+ return setup({ props, context, renderless, api })
}
})
diff --git a/packages/vue/src/cascader/__tests__/cascader.test.ts b/packages/vue/src/cascader/__tests__/cascader.test.ts
deleted file mode 100644
index 3d6b9fcc3..000000000
--- a/packages/vue/src/cascader/__tests__/cascader.test.ts
+++ /dev/null
@@ -1,71 +0,0 @@
-import { describe, it } from 'vitest'
-
-describe('测试 Cascader 在不穿任何参数情况下的默认行为', () => {
- it.todo('级联输入框的渲染,正确渲染输入框和图标')
-
- it.todo('hover 效果,输入框边框颜色变深')
-
- it.todo('点击输入框,应该弹出级联下拉面板,输入框边框颜色变深,向下图标切换为向上图标')
-
- it.todo('级联下拉面板渲染,下拉数据是否正常渲染,不为最后一级的每行子项正常渲染图标')
-
- it.todo('点击不同父级展开相应子级数据,点击子级数据下拉面板小时,输入框出现选中的子级数据')
-})
-
-describe('测试单个 api 功能', () => {
- it.todo('v-model 是否正常, 设置了v-model是否显示在输入框中')
-
- it.todo('配置 options,下拉框展示相应的options的长度')
-
- it.todo('配置 props ,设置options对应的字段名称是否正常渲染在下拉面板')
-
- it.todo('配置 clearable ,当输入框有值,悬浮输入框时出现关闭按钮,点击关闭按钮,情况输入框数据')
-
- it.todo('配置 separator ,检验输入框是否存在配置的分隔符')
-
- it.todo('配置 size ,检验输入框的dom是否存在配置的size')
-
- it.todo('配置 props.multiple = true ,v-model为多元素数组时,输入框是否展示多个标签')
-
- it.todo('配置 collapse-tags ,选中多个选项时,输入框最多存在2个标签,第二个标签展示为+ 选中数量')
-
- it.todo('配置 props.checkStrictly = true ,当options为多级数据时,是否每级数据可以单独选中')
-
- it.todo(
- '同时配置 props.multiple = true,props.checkStrictly = true ,当options为多级数据时,是否每级数据可以单独选中且输入框显示相应选中的标签'
- )
-
- it.todo(
- '配置 lazyload ,配置多级数据,点击输入框出现第一个下拉框,点击第一个下拉框里的选项,出现加载图标并在之后出现下一个下拉框'
- )
-
- it.todo('配置 filterable,输入框输入搜索的内容,出现下拉框,当有相关内容时展示相关内容,无相关内容展示无匹配数据')
-
- it.todo(
- '配置 filterable与debounceit时,输入框输入搜索的内容,根据配置的debounceit延时出现下拉框,当有相关内容时展示相关内容,无相关内容展示无匹配数据'
- )
-
- it.todo('配置 placeholder ,输入框的dom是否存在配置的placeholder')
-
- it.todo(
- '配置 filter-method ,点击输入框,出现下拉框,输入框输入内容,下拉框展示的数据是否为对应的filter-method处理后的数据'
- )
-
- it.todo(
- '配置 show-all-levels = false ,点击输入框,出现下拉框,点击父级,出现下一级,直到最后一级,选择最后一级任一选项,输入框内容仅展示最后一级选择内容'
- )
-})
-
-describe('测试 events', () => {
- it.todo('change, 选中节点变化时触发')
-
- it.todo('expand-change,展开节点发生变化时触发')
-
- it.todo('blur,失去焦点时触发')
-
- it.todo('blur,获得焦点时触发')
-
- it.todo('visible-change,下拉框出现/隐藏时触发')
-
- it.todo('remove-tag,多选模式下,移除Tag时触发')
-})
diff --git a/packages/vue/src/cascader/__tests__/cascader.test.tsx b/packages/vue/src/cascader/__tests__/cascader.test.tsx
index bed973a01..4f0c729c8 100644
--- a/packages/vue/src/cascader/__tests__/cascader.test.tsx
+++ b/packages/vue/src/cascader/__tests__/cascader.test.tsx
@@ -119,4 +119,76 @@ describe('PC Mode', () => {
expect(wrapper.find('.tiny-cascader__empty-text').exists()).toBe(true)
})
+
+ // 通过 options 属性指定选项数组即可渲染出一个级联选择器
+ test.todo('options')
+
+ // 通过 props.expandTrigger 可以指定展开子级菜单的触发方式为 hover,默认为 click
+ test.todo('props.expandTrigger')
+
+ // 通过在数据源中设置 disabled 字段来声明该选项是禁用的,本例中,options 指定的数组中的第一个元素含有 disabled: true 键值对,因此是禁用的。在默认情况下,Cascader 会检查数据中每一项的 disabled 字段是否为 true,如果你的数据中表示禁用含义的字段名不为 disabled,可以通过 props.disabled 属性来指定(详见 Cascader Props 的 API 表格)。当然,value、label 和 children 这三个字段名也可以通过同样的方式指定
+ test.todo('disabled')
+
+ // 通过 props 属性设置属性值映射
+ test.todo('props')
+
+ // 通过 clearable 属性设置输入框可清空
+ test.todo('clearable')
+
+ // 通过 separator 属性设置分隔符
+ test.todo('separator')
+
+ // 通过 props.multiple = true 来开启多选模式
+ test.todo('props.multiple = true')
+
+ // 在开启多选模式后,默认情况下会展示所有已选中的选项的 Tag,可以使用 collapse-tags 来折叠 Tag 。 通过 disabled 设置组件是否禁用,默认值为 false
+ test.todo('collapse-tags')
+
+ // 通过 props.checkStrictly = true 来设置父子节点取消选中关联,从而达到选择任意一级选项的目的。默认单选模式下,只能选择叶子节点
+ test.todo('props.checkStrictly = true')
+
+ // 在多选模式下同时取消父子节点关联,选择任意一级选项
+ test.todo('check-strictly-multiple')
+
+ // 当选中某一级时,动态加载该级下的选项。通过 props 属性中的 lazy 开启动态加载,并通过 lazyload 来设置加载数据源的方法。lazyload 方法有两个参数,第一个参数 node 为当前点击的节点,第二个 resolve 为数据加载完成的回调(必须调用)。为了更准确的显示节点的状态,还可以对节点数据添加是否为叶子节点的标志位 (默认字段为 leaf,可通过 props.leaf 修改),否则会简单的以有无子节点来判断是否为叶子节点
+ test.todo('auto-load')
+
+ // 当选中某一级时,动态加载该级下的选项。通过 props 属性中的 lazy 开启动态加载,并通过 lazyload 来设置加载数据源的方法。通过 props 属性中的 checkStrictly 开启父子级不相关联
+ test.todo('auto-load-checkStrictly')
+
+ // 通过 children 指定选项的子选项,默认为 children 。 通过 value 指定指定选项的 value 值,默认为 value 。 通过 label 指定选项标签,默认为 label
+ test.todo('props-children')
+
+ // 将 filterable 赋值为 true 即可打开搜索功能,默认会匹配节点的 label 或所有父节点的 label (由 show-all-levels 决定)中包含输入值的选项。 empty 无匹配选项时显示的内容
+ test.todo('filterable')
+
+ // 搜索延时
+ test.todo('debounce')
+
+ // 多选模式下开启搜索功能
+ test.todo('filterable-multiple')
+
+ // filter-method 自定义搜索逻辑,第一个参数是节点 node,第二个参数是搜索关键词 keyword,通过返回布尔值表示是否命中,如果需要选择父级,通过 props.checkStrictly = true 来设置父子节点取消选中关联,从而达到选择任意一级选项的目的。默认单选模式下,只能选择叶子节点
+ test.todo('filter-method')
+
+ // placeholder
+ test.todo('placeholder')
+
+ // 仅显示最后一级
+ test.todo('show-all-levels')
+
+ // change事件
+ test.todo('change')
+
+ // expand-change事件
+ test.todo('expand-change')
+
+ // blur事件
+ test.todo('blur')
+
+ // visible-change事件
+ test.todo('visible-change')
+
+ // 节点返回的数据类型
+ test.todo('props="{ emitPath: false }')
})
diff --git a/packages/vue/src/cascader/src/index.ts b/packages/vue/src/cascader/src/index.ts
index 5c4124dc2..250c60c74 100644
--- a/packages/vue/src/cascader/src/index.ts
+++ b/packages/vue/src/cascader/src/index.ts
@@ -62,10 +62,20 @@ export default defineComponent({
type: Boolean,
default: true
},
- size: String
+ size: String,
+ shape: String,
+ label: String,
+ tip: String,
+ displayOnly: {
+ type: Boolean,
+ default: false
+ },
+ hoverExpand: {
+ type: Boolean,
+ default: false
+ }
},
setup(props, context) {
return $setup({ props, context, template })
}
-}
-)
+})
diff --git a/packages/vue/src/cascader/src/pc.vue b/packages/vue/src/cascader/src/pc.vue
index 5b772308f..72e353c79 100644
--- a/packages/vue/src/cascader/src/pc.vue
+++ b/packages/vue/src/cascader/src/pc.vue
@@ -16,7 +16,10 @@
'tiny-cascader',
state.realSize && `tiny-cascader--${state.realSize}`,
{ 'is-disabled': state.isDisabled },
- { 'tiny-cascader-multiple': state.multiple }
+ { 'tiny-cascader-multiple': state.multiple },
+ { 'is-display-only': state.isDisplayOnly },
+ { 'show-auto-width': state.showAutoWidth },
+ { 'is-hover-expand': hoverExpand }
]"
v-clickoutside="() => toggleDropDownVisible(false)"
@mouseenter="state.inputHover = true"
@@ -24,59 +27,111 @@
@click="() => toggleDropDownVisible(state.readonly ? undefined : true)"
@keydown="handleKeyDown"
>
-
-
-
-
-
-
-