kui-vue 3.6.0 → 3.6.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 → README.md} +4 -10
- package/components/button/demo/group.md +1 -1
- package/components/button/demo/size.md +1 -1
- package/components/card/card.jsx +1 -1
- package/components/checkbox/checkbox.jsx +17 -16
- package/components/checkbox/checkboxGroup.jsx +5 -5
- package/components/checkbox/demo/group.md +17 -6
- package/components/checkbox/styles/index.less +4 -11
- package/components/collapse/collapse.jsx +9 -10
- package/components/collapse/demo/accordion.md +2 -2
- package/components/collapse/demo/basic.md +2 -2
- package/components/collapse/demo/extra.md +2 -2
- package/components/collapse/demo/nesting.md +4 -4
- package/components/collapse/demo/sample.md +2 -2
- package/components/collapse/index.md +6 -6
- package/components/colorPicker/colorpicker.jsx +5 -6
- package/components/colorPicker/demo/basic.md +14 -2
- package/components/colorPicker/demo/customTrigger.md +2 -2
- package/components/colorPicker/demo/index.jsx +0 -8
- package/components/colorPicker/demo/size.md +24 -10
- package/components/datePicker/datepicker.jsx +19 -11
- package/components/datePicker/demo/basic.md +15 -6
- package/components/datePicker/demo/lang.md +2 -2
- package/components/datePicker/demo/size.md +1 -1
- package/components/drawer/drawer.jsx +2 -2
- package/components/dropdown/dropdown.jsx +9 -40
- package/components/dropdown/dropdownButton.jsx +18 -7
- package/components/empty/demo/basic.md +1 -3
- package/components/empty/demo/nodesc.md +1 -3
- package/components/empty/demo/used.md +4 -6
- package/components/empty/empty.jsx +19 -17
- package/components/empty/styles/index.less +18 -5
- package/components/form/demo/align.md +10 -10
- package/components/form/demo/valid.md +3 -2
- package/components/form/form.jsx +1 -1
- package/components/form/formitem.jsx +1 -1
- package/components/image/image.jsx +1 -0
- package/components/image/preview.jsx +1 -1
- package/components/input/demo/basic.md +1 -1
- package/components/input/demo/group.md +1 -1
- package/components/input/index.md +1 -1
- package/components/input/input.jsx +7 -5
- package/components/input/inputBox.jsx +2 -2
- package/components/inputNumber/demo/basic.md +12 -5
- package/components/inputNumber/demo/format.md +0 -5
- package/components/inputNumber/index.md +1 -1
- package/components/inputNumber/inputNumber.jsx +3 -5
- package/components/inputNumber/styles/index.less +64 -64
- package/components/menu/submenu.jsx +5 -5
- package/components/message/demo/close.md +1 -1
- package/components/message/group.jsx +2 -2
- package/components/message/index.md +1 -1
- package/components/message/inner.jsx +26 -7
- package/components/notice/demo/close.md +1 -1
- package/components/notice/index.md +1 -1
- package/components/page/page.jsx +0 -1
- package/components/page/styles/index.less +7 -1
- package/components/popconfirm/popconfirm.jsx +18 -20
- package/components/poptip/poptip.jsx +4 -4
- package/components/progress/progress.jsx +1 -1
- package/components/radio/demo/group.md +16 -6
- package/components/radio/demo/radioButton.md +3 -8
- package/components/radio/radio.jsx +14 -11
- package/components/radio/radioButton.jsx +1 -1
- package/components/radio/radioGroup.jsx +9 -12
- package/components/radio/styles/index.less +10 -21
- package/components/rate/demo/basic.md +12 -2
- package/components/rate/demo/character.md +16 -2
- package/components/rate/demo/index.jsx +0 -8
- package/components/rate/demo/tips.md +15 -5
- package/components/rate/rate.jsx +24 -5
- package/components/select/demo/basic.md +16 -7
- package/components/select/demo/filterable.md +4 -2
- package/components/select/demo/size.md +1 -1
- package/components/select/index.md +23 -22
- package/components/select/option.jsx +7 -3
- package/components/select/select.jsx +43 -37
- package/components/select/styles/index.less +1 -0
- package/components/slider/demo/basic.md +2 -1
- package/components/slider/demo/withNumber.md +3 -3
- package/components/slider/slider.jsx +0 -25
- package/components/space/styles/index.less +5 -1
- package/components/spin/index.md +6 -5
- package/components/styles/sys.less +3 -0
- package/components/switch/switch.jsx +13 -5
- package/components/table/demo/size.md +1 -1
- package/components/table/styles/index.less +10 -5
- package/components/table/table.jsx +98 -69
- package/components/tabs/tabs.jsx +1 -1
- package/components/tooltip/tooltip.jsx +16 -11
- package/components/treeselect/demo/basic.md +11 -8
- package/components/treeselect/demo/size.md +6 -5
- package/components/treeselect/demo/theme.md +0 -1
- package/components/treeselect/treeselect.jsx +15 -20
- package/components/upload/upload.jsx +0 -1
- package/components/utils/placement.js +162 -124
- package/dist/k-ui.cjs.js +2 -2
- package/dist/k-ui.css +2 -2
- package/dist/k-ui.d.ts +131 -127
- package/dist/k-ui.esm.js +2 -2
- package/dist/k-ui.umd.js +2 -2
- package/dist/locale/de.js +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/ua.js +2 -2
- package/dist/locale/uk.js +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/zh-CN.js +1 -1
- package/dist/locale/zh-TW.js +1 -1
- package/package.json +5 -5
- package/test/i18n@8.x.html +6 -2
- package/types/checkbox/Checkbox.d.ts +1 -1
- package/types/collapse/Collapse.d.ts +1 -1
- package/types/image/KImage.d.ts +1 -0
- package/types/index.d.ts +12 -12
- package/types/popconfirm/Popconfirm.d.ts +1 -0
- package/types/radio/Radio.d.ts +1 -1
- package/types/radio/RadioButton.d.ts +1 -1
- package/types/switch/Switch.d.ts +2 -1
- package/types/tooltip/Tooltip.d.ts +1 -0
- package/components/base/collapse.jsx +0 -15
- package/components/base/input.jsx +0 -210
- package/components/colorPicker/demo/disabled.md +0 -16
- package/components/colorPicker/demo/disabledAlpha.md +0 -13
- package/components/colorPicker/demo/mode.md +0 -24
- package/components/colorPicker/demo/presets.md +0 -17
- package/components/rate/demo/clear.md +0 -13
- package/components/rate/demo/custom.md +0 -23
- package/components/rate/demo/disabled.md +0 -12
- package/components/rate/demo/half.md +0 -12
- package/components/steps/index.js +0 -4
- package/components/steps/step.vue +0 -82
- package/components/steps/steps.vue +0 -68
- package/components/steps/styles/index.less +0 -198
- package/components/utils/element.js +0 -122
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent, ref, watch } from "vue";
|
|
1
|
+
import { defineComponent, ref, watch, computed } from "vue";
|
|
2
2
|
import Radio from "./radio.jsx";
|
|
3
3
|
import RadioButton from "./radioButton.jsx";
|
|
4
4
|
import { withInstall } from "../utils/vue";
|
|
5
|
-
import { getChildren } from "../utils/
|
|
5
|
+
import { getChildren } from "../utils/vnode";
|
|
6
6
|
|
|
7
7
|
const RadioGroup = defineComponent({
|
|
8
8
|
name: "RadioGroup",
|
|
@@ -32,7 +32,6 @@ const RadioGroup = defineComponent({
|
|
|
32
32
|
setup(props, { slots, emit }) {
|
|
33
33
|
// [Vue 3 Upgrade]: const { modelValue: currentValue } = toRefs(props);
|
|
34
34
|
const currentValue = ref(props.value);
|
|
35
|
-
const currentType = ref(props.type);
|
|
36
35
|
const onChange = ({ value }) => {
|
|
37
36
|
currentValue.value = value;
|
|
38
37
|
// [Vue 3 Upgrade]: emit("update:modelValue", val);
|
|
@@ -45,7 +44,7 @@ const RadioGroup = defineComponent({
|
|
|
45
44
|
currentValue.value = val;
|
|
46
45
|
}
|
|
47
46
|
);
|
|
48
|
-
const optionsData = () => {
|
|
47
|
+
const optionsData = computed(() => {
|
|
49
48
|
let { options } = props;
|
|
50
49
|
if (!options) {
|
|
51
50
|
options = [];
|
|
@@ -55,9 +54,6 @@ const RadioGroup = defineComponent({
|
|
|
55
54
|
let { label, value, disabled, icon } =
|
|
56
55
|
child?.componentOptions?.propsData || {};
|
|
57
56
|
let { children = [], tag } = child?.componentOptions;
|
|
58
|
-
if (tag == "RadioButton") {
|
|
59
|
-
currentType.value = "button";
|
|
60
|
-
}
|
|
61
57
|
options.push({
|
|
62
58
|
value,
|
|
63
59
|
icon,
|
|
@@ -67,11 +63,11 @@ const RadioGroup = defineComponent({
|
|
|
67
63
|
});
|
|
68
64
|
}
|
|
69
65
|
return options;
|
|
70
|
-
};
|
|
66
|
+
});
|
|
71
67
|
return () => {
|
|
72
|
-
let options = optionsData
|
|
68
|
+
let options = optionsData.value;
|
|
73
69
|
let nodes = [];
|
|
74
|
-
const Component =
|
|
70
|
+
const Component = props.type === "button" ? RadioButton : Radio;
|
|
75
71
|
options.forEach((option) =>
|
|
76
72
|
nodes.push(
|
|
77
73
|
<Component
|
|
@@ -90,11 +86,12 @@ const RadioGroup = defineComponent({
|
|
|
90
86
|
const classes = [
|
|
91
87
|
"k-radio-group",
|
|
92
88
|
{
|
|
89
|
+
"k-radio-button-group": props.type === "button",
|
|
93
90
|
"k-radio-circle": props.shape === "circle",
|
|
94
91
|
"k-radio-group-light":
|
|
95
|
-
props.theme === "light" &&
|
|
92
|
+
props.theme === "light" && props.type === "button",
|
|
96
93
|
"k-radio-group-card":
|
|
97
|
-
props.theme === "card" &&
|
|
94
|
+
props.theme === "card" && props.type === "button",
|
|
98
95
|
"k-radio-group-vertical": props.direction === "vertical",
|
|
99
96
|
},
|
|
100
97
|
];
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
@import "../../styles/var.less";
|
|
2
2
|
|
|
3
3
|
.k-radio-group {
|
|
4
|
-
// display: inline-block;
|
|
5
4
|
display: inline-flex;
|
|
6
5
|
flex-shrink: 0;
|
|
7
6
|
align-items: center;
|
|
8
|
-
// font-size: 0;
|
|
9
|
-
// vertical-align: middle;
|
|
10
|
-
white-space: nowrap;
|
|
11
|
-
|
|
12
7
|
.k-btn {
|
|
13
8
|
position: relative;
|
|
14
9
|
margin-left: -1px;
|
|
@@ -46,19 +41,18 @@
|
|
|
46
41
|
border-color: var(--kui-color-main);
|
|
47
42
|
}
|
|
48
43
|
|
|
49
|
-
.k-radio {
|
|
50
|
-
margin-right: 16px;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
44
|
.k-radio-label {
|
|
54
45
|
font-size: 14px;
|
|
55
46
|
}
|
|
56
|
-
|
|
57
|
-
// .k-btn-solid {
|
|
58
|
-
// margin-left: -1px;
|
|
59
|
-
// }
|
|
60
47
|
}
|
|
61
|
-
|
|
48
|
+
.k-radio-button-group,
|
|
49
|
+
.k-radio-group-card {
|
|
50
|
+
flex-wrap: nowrap;
|
|
51
|
+
}
|
|
52
|
+
.k-radio-group:not(.k-radio-button-group, .k-radio-group-card) {
|
|
53
|
+
gap: 16px;
|
|
54
|
+
flex-wrap: wrap;
|
|
55
|
+
}
|
|
62
56
|
.k-radio-circle:not(.k-radio-group-card) {
|
|
63
57
|
.k-btn:first-child {
|
|
64
58
|
border-top-left-radius: 30px;
|
|
@@ -208,13 +202,8 @@
|
|
|
208
202
|
}
|
|
209
203
|
|
|
210
204
|
.k-radio-group-vertical {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
.k-radio {
|
|
214
|
-
display: block;
|
|
215
|
-
margin-right: 0;
|
|
216
|
-
margin-bottom: 16px;
|
|
217
|
-
}
|
|
205
|
+
flex-direction: column;
|
|
206
|
+
align-items: self-start;
|
|
218
207
|
}
|
|
219
208
|
|
|
220
209
|
.k-radio-group-light {
|
|
@@ -6,13 +6,23 @@
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
8
|
<Space vertical>
|
|
9
|
+
<code>v-model: {{ value }}</code>
|
|
10
|
+
<Rate v-model="value" />
|
|
11
|
+
<code>show score</code>
|
|
12
|
+
<Rate :value="2.5" showScore />
|
|
13
|
+
<code>size = 30</code>
|
|
9
14
|
<Rate :size="30" :value="2" />
|
|
10
|
-
<
|
|
15
|
+
<code>custom icon</code>
|
|
16
|
+
<Rate :icon="Heart" color="red" :value="2.5" :size="30" />
|
|
17
|
+
<code>allowHalf = true</code>
|
|
11
18
|
<Rate :icon="Heart" allowHalf color="red" :value="2.5" :size="30" />
|
|
12
|
-
|
|
19
|
+
<code>disabled (readonly)</code>
|
|
20
|
+
<Rate :value="3.7" disabled showScore/>
|
|
13
21
|
</Space>
|
|
14
22
|
</template>
|
|
15
23
|
<script setup>
|
|
24
|
+
import { ref } from "vue";
|
|
16
25
|
import { Heart } from "kui-icons";
|
|
26
|
+
const value = ref(3);
|
|
17
27
|
</script>
|
|
18
28
|
```
|
|
@@ -7,11 +7,25 @@
|
|
|
7
7
|
<template>
|
|
8
8
|
<Space vertical>
|
|
9
9
|
<Rate :icon="Heart" allowHalf :value="1.5" />
|
|
10
|
-
<
|
|
10
|
+
<code>character = A</code>
|
|
11
|
+
<Rate character="A" allowHalf :value="2.5" />
|
|
12
|
+
<code>character = 龍</code>
|
|
11
13
|
<Rate character="龍" allowHalf :value="3.5" :size="24" />
|
|
14
|
+
<br />
|
|
15
|
+
<code>count = 9</code>
|
|
16
|
+
<Rate :character="(i) => i" :value="2" :count="9" />
|
|
17
|
+
<Rate :icon="(i) => icons[i - 1]" :value="3" />
|
|
12
18
|
</Space>
|
|
13
19
|
</template>
|
|
14
20
|
<script setup>
|
|
15
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
Heart,
|
|
23
|
+
VolumeOff,
|
|
24
|
+
VolumeLow,
|
|
25
|
+
VolumeMedium,
|
|
26
|
+
VolumeHigh,
|
|
27
|
+
VolumeMute,
|
|
28
|
+
} from "kui-icons";
|
|
29
|
+
const icons = [VolumeOff, VolumeLow, VolumeMedium, VolumeHigh, VolumeMute];
|
|
16
30
|
</script>
|
|
17
31
|
```
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import Info from "./info.md";
|
|
2
2
|
import Basic from './basic.md';
|
|
3
|
-
import Half from "./half.md";
|
|
4
3
|
import Tips from "./tips.md";
|
|
5
|
-
import Disabled from "./disabled.md";
|
|
6
|
-
import Clear from "./clear.md";
|
|
7
4
|
import Character from "./character.md";
|
|
8
|
-
import Custom from "./custom.md";
|
|
9
5
|
|
|
10
6
|
import CN from "../index.md";
|
|
11
7
|
export default {
|
|
@@ -14,12 +10,8 @@ export default {
|
|
|
14
10
|
<div class="demo-rate">
|
|
15
11
|
<Info />
|
|
16
12
|
<Basic />
|
|
17
|
-
<Half />
|
|
18
13
|
<Tips />
|
|
19
|
-
<Disabled />
|
|
20
|
-
<Clear />
|
|
21
14
|
<Character />
|
|
22
|
-
<Custom />
|
|
23
15
|
<CN />
|
|
24
16
|
</div>
|
|
25
17
|
);
|
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
<cn>
|
|
2
|
-
### 文案展现
|
|
2
|
+
### 文案展现 / 允许清除
|
|
3
3
|
给评分组件加上文案展示。
|
|
4
4
|
</cn>
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<Space>
|
|
9
|
-
<
|
|
10
|
-
|
|
8
|
+
<Space vertical>
|
|
9
|
+
<Space>
|
|
10
|
+
<Rate :tooltips="desc" v-model="value" />
|
|
11
|
+
{{ tipText }}
|
|
12
|
+
</Space>
|
|
13
|
+
<br />
|
|
14
|
+
<code>allowClear = true</code>
|
|
15
|
+
<Rate :allowClear="true" :value="3" />
|
|
16
|
+
<code>allowClear = false</code>
|
|
17
|
+
<Rate :allowClear="false" :value="3" />
|
|
11
18
|
</Space>
|
|
12
19
|
</template>
|
|
13
20
|
<script setup>
|
|
14
|
-
import { ref } from "vue";
|
|
21
|
+
import { ref, computed } from "vue";
|
|
15
22
|
const value = ref(3);
|
|
16
23
|
const desc = ["terrible", "bad", "normal", "good", "wonderful"];
|
|
24
|
+
const tipText = computed(() => {
|
|
25
|
+
return desc[value.value - 1];
|
|
26
|
+
});
|
|
17
27
|
</script>
|
|
18
28
|
```
|
package/components/rate/rate.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Star from "./star";
|
|
2
|
-
import { defineComponent, ref } from "vue";
|
|
3
|
-
import { withInstall } from
|
|
2
|
+
import { defineComponent, ref, watch } from "vue";
|
|
3
|
+
import { withInstall } from "../utils/vue";
|
|
4
4
|
const Rate = defineComponent({
|
|
5
5
|
name: "Rate",
|
|
6
6
|
props: {
|
|
@@ -20,6 +20,12 @@ const Rate = defineComponent({
|
|
|
20
20
|
const initValue = ref(ps.value);
|
|
21
21
|
const tempValue = ref();
|
|
22
22
|
const cleared = ref(false);
|
|
23
|
+
watch(
|
|
24
|
+
() => ps.value,
|
|
25
|
+
(v) => {
|
|
26
|
+
initValue.value = v;
|
|
27
|
+
}
|
|
28
|
+
);
|
|
23
29
|
const update = (t, index, percent) => {
|
|
24
30
|
if (t == "M") {
|
|
25
31
|
if (cleared.value) return;
|
|
@@ -41,6 +47,7 @@ const Rate = defineComponent({
|
|
|
41
47
|
}
|
|
42
48
|
// emit("update:value", initValue.value); //for 3
|
|
43
49
|
emit("input", initValue.value);
|
|
50
|
+
emit("change", initValue.value);
|
|
44
51
|
}
|
|
45
52
|
};
|
|
46
53
|
|
|
@@ -51,7 +58,17 @@ const Rate = defineComponent({
|
|
|
51
58
|
|
|
52
59
|
return () => {
|
|
53
60
|
const tpValue = tempValue.value || initValue.value;
|
|
54
|
-
let {
|
|
61
|
+
let {
|
|
62
|
+
count,
|
|
63
|
+
allowHalf,
|
|
64
|
+
character,
|
|
65
|
+
disabled,
|
|
66
|
+
tooltips = [],
|
|
67
|
+
icon,
|
|
68
|
+
showScore,
|
|
69
|
+
size,
|
|
70
|
+
color,
|
|
71
|
+
} = ps;
|
|
55
72
|
const stars = [];
|
|
56
73
|
if (isNaN(Number(count)) || count <= 0) {
|
|
57
74
|
count = 5;
|
|
@@ -76,7 +93,7 @@ const Rate = defineComponent({
|
|
|
76
93
|
},
|
|
77
94
|
on: {
|
|
78
95
|
update: update,
|
|
79
|
-
}
|
|
96
|
+
},
|
|
80
97
|
// onUpdate: update, //for 3
|
|
81
98
|
};
|
|
82
99
|
stars.push(<Star {...sp} />);
|
|
@@ -95,7 +112,9 @@ const Rate = defineComponent({
|
|
|
95
112
|
return (
|
|
96
113
|
<div {...props}>
|
|
97
114
|
{stars}
|
|
98
|
-
{showScore ?
|
|
115
|
+
{showScore ? (
|
|
116
|
+
<span class="k-rate-score">{initValue.value}</span>
|
|
117
|
+
) : null}
|
|
99
118
|
</div>
|
|
100
119
|
);
|
|
101
120
|
};
|
|
@@ -11,11 +11,9 @@
|
|
|
11
11
|
<br />
|
|
12
12
|
use children to set options
|
|
13
13
|
<Select v-model="value2">
|
|
14
|
-
<Option :value="
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<Option :value="3" label="Banana" />
|
|
18
|
-
<Option :value="4" label="Pear" />
|
|
14
|
+
<Option :value="item.value" v-for="item in data" :key="item.value">
|
|
15
|
+
{{ item.label }}
|
|
16
|
+
</Option>
|
|
19
17
|
</Select>
|
|
20
18
|
</Space>
|
|
21
19
|
</template>
|
|
@@ -23,12 +21,23 @@
|
|
|
23
21
|
import { ref } from "vue";
|
|
24
22
|
const value1 = ref(2);
|
|
25
23
|
const value2 = ref(2);
|
|
26
|
-
const data = [
|
|
24
|
+
const data = ref([
|
|
27
25
|
{ label: "Apple", value: 0 },
|
|
28
26
|
{ label: "Orange", value: 1 },
|
|
29
27
|
{ label: "Banana", value: 2 },
|
|
30
28
|
{ label: "Pear", value: 3 },
|
|
31
29
|
{ label: "Grape", value: 4 },
|
|
32
|
-
];
|
|
30
|
+
]);
|
|
31
|
+
// 异步加载数据
|
|
32
|
+
setTimeout(() => {
|
|
33
|
+
data.value = [
|
|
34
|
+
{ label: "Apple1", value: 0 },
|
|
35
|
+
{ label: "Orange1", value: 1 },
|
|
36
|
+
{ label: "Banana2", value: 2 },
|
|
37
|
+
{ label: "Pear1", value: 3 },
|
|
38
|
+
{ label: "Grape2", value: 4 },
|
|
39
|
+
];
|
|
40
|
+
value2.value = 2;
|
|
41
|
+
}, 1000);
|
|
33
42
|
</script>
|
|
34
43
|
```
|
|
@@ -59,10 +59,12 @@ const value4 = ref([]);
|
|
|
59
59
|
const loading = ref(false);
|
|
60
60
|
|
|
61
61
|
const optionsData = ref([]);
|
|
62
|
-
const fetchData = () => {
|
|
62
|
+
const fetchData = (e) => {
|
|
63
63
|
loading.value = true;
|
|
64
64
|
setTimeout(() => {
|
|
65
|
-
optionsData.value = options
|
|
65
|
+
optionsData.value = options.filter((v) =>
|
|
66
|
+
v.includes(e.target.value.trim())
|
|
67
|
+
);
|
|
66
68
|
loading.value = false;
|
|
67
69
|
}, 1000);
|
|
68
70
|
};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
8
|
<Space vertical block>
|
|
9
|
-
<RadioGroup v-model="size" @change="setSize">
|
|
9
|
+
<RadioGroup v-model="size" @change="setSize" type="button">
|
|
10
10
|
<RadioButton value="large" label="large" />
|
|
11
11
|
<RadioButton value="default" label="default" />
|
|
12
12
|
<RadioButton value="small" label="small" />
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
## Select API
|
|
2
2
|
|
|
3
|
-
| 属性 | 说明 | 类型
|
|
4
|
-
| ----------- | ---------------------------------------------------------- |
|
|
5
|
-
| value | 指定选中项目的 `value` 值,可以使用 `v-model` 双向绑定数据 | String,Number
|
|
6
|
-
| width | 组件宽度 | String,Number
|
|
7
|
-
| placeholder | 选择框默认文字 | String
|
|
8
|
-
| disabled | 是否禁用当前项 | Boolean
|
|
9
|
-
| size | 组件尺寸大小,提供`small`,`large`两种尺寸,默认为正常 | String
|
|
10
|
-
| emptyText | 没有数据时展示的提示 | String
|
|
11
|
-
| maxTagCount | 最多展示多少个tag,超出部分以点点点展示 | Number
|
|
12
|
-
| multiple | 是否呈现多选模式 | Boolean
|
|
13
|
-
| loading | 是否显示异步加载 | Boolean
|
|
14
|
-
| clearable | 是否可以清空选项 | Boolean
|
|
15
|
-
| bordered | 是否显示边框 | Boolean
|
|
16
|
-
| extendWidth | 下拉框的宽度是否与input一致 | Boolean
|
|
17
|
-
| showArrow | 是否显示下拉按钮 | Boolean
|
|
18
|
-
| change |
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
|
|
|
3
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
4
|
+
| ----------- | ---------------------------------------------------------- | ------------------------------- | ---------- |
|
|
5
|
+
| value | 指定选中项目的 `value` 值,可以使用 `v-model` 双向绑定数据 | String,Number | - |
|
|
6
|
+
| width | 组件宽度 | String,Number | - |
|
|
7
|
+
| placeholder | 选择框默认文字 | String | 请选择 |
|
|
8
|
+
| disabled | 是否禁用当前项 | Boolean | false |
|
|
9
|
+
| size | 组件尺寸大小,提供`small`,`large`两种尺寸,默认为正常 | String | - |
|
|
10
|
+
| emptyText | 没有数据时展示的提示 | String | '赞无数据' |
|
|
11
|
+
| maxTagCount | 最多展示多少个tag,超出部分以点点点展示 | Number | - |
|
|
12
|
+
| multiple | 是否呈现多选模式 | Boolean | false |
|
|
13
|
+
| loading | 是否显示异步加载 | Boolean | false |
|
|
14
|
+
| clearable | 是否可以清空选项 | Boolean | false |
|
|
15
|
+
| bordered | 是否显示边框 | Boolean | true |
|
|
16
|
+
| extendWidth | 下拉框的宽度是否与input一致 | Boolean | true |
|
|
17
|
+
| showArrow | 是否显示下拉按钮 | Boolean | true |
|
|
18
|
+
| change | 在选项状态发生改变时触发,,返回选择的值value | Function(value) | - |
|
|
19
|
+
| select | 选中一项时触发 | Function({value,label,checked}) | - |
|
|
20
|
+
| openChange | 下拉框展开或收起时触发 | Function | - |
|
|
21
|
+
| options | options 数据,如果设置则不需要手动构造 Option 节点 | Array <{value,label,disabled}> | [] |
|
|
22
|
+
| theme | theme='light' 时呈现浅色主题 | String | - |
|
|
23
|
+
| icon | 自定义图标 | String | - |
|
|
24
|
+
| shape | shape='circle' 时呈现圆角 | String | - |
|
|
24
25
|
|
|
25
26
|
## Option API
|
|
26
27
|
|
|
@@ -29,4 +30,4 @@
|
|
|
29
30
|
| key | 和 value 含义一致。如果 Vue 需要你设置此项,此项值与 value 的值相同,然后可以省略 value 设置 | String,Number | - |
|
|
30
31
|
| value | 选项值,默认根据此属性值进行筛选,必填 | String,Number | - |
|
|
31
32
|
| label | 选项显示的内容 | String,Number | - |
|
|
32
|
-
| disabled | 是否禁用当前项 | Boolean | false |
|
|
33
|
+
| disabled | 是否禁用当前项 | Boolean | false |
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import Icon from "../icon";
|
|
2
2
|
import { Checkmark } from "kui-icons";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
defineComponent,
|
|
5
|
+
computed,
|
|
6
|
+
inject,
|
|
7
|
+
} from "vue";
|
|
8
|
+
import { withInstall } from "../utils/vue";
|
|
5
9
|
const Option = defineComponent({
|
|
6
10
|
name: "Option",
|
|
7
11
|
props: {
|
|
@@ -44,4 +48,4 @@ const Option = defineComponent({
|
|
|
44
48
|
};
|
|
45
49
|
},
|
|
46
50
|
});
|
|
47
|
-
export default withInstall(Option);
|
|
51
|
+
export default withInstall(Option);
|