kui-vue 3.6.2 → 3.6.3
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/components/card/card.jsx +19 -9
- package/components/card/demo/basic.md +3 -3
- package/components/card/demo/border.md +1 -7
- package/components/card/demo/index.jsx +9 -7
- package/components/card/demo/notitle.md +23 -0
- package/components/card/styles/index.less +5 -3
- package/components/checkbox/styles/index.less +1 -0
- package/components/collapse/styles/index.less +2 -2
- package/components/colorPicker/mode.jsx +1 -1
- package/components/components.js +3 -0
- package/components/drawer/demo/target.md +2 -2
- package/components/dropdown/demo/basic.md +1 -1
- package/components/dropdown/styles/index.less +1 -0
- package/components/flex/demo/size.md +14 -5
- package/components/form/demo/customvalid.md +1 -1
- package/components/form/demo/dynamicvalid.md +1 -1
- package/components/form/demo/length.md +1 -13
- package/components/form/demo/valid.md +9 -1
- package/components/form/form.jsx +1 -1
- package/components/input/input.jsx +12 -10
- package/components/inputNumber/demo/basic.md +1 -0
- package/components/inputNumber/demo/format.md +3 -8
- package/components/inputNumber/inputNumber.jsx +116 -139
- package/components/inputNumber/styles/index.less +3 -3
- package/components/layout/demo/layout5.md +0 -1
- package/components/locale/de.js +1 -0
- package/components/locale/el.js +1 -0
- package/components/locale/en.js +1 -0
- package/components/locale/fr.js +1 -0
- package/components/locale/it.js +1 -0
- package/components/locale/ja.js +1 -0
- package/components/locale/ko.js +1 -0
- package/components/locale/ru.js +1 -0
- package/components/locale/th.js +1 -0
- package/components/locale/uk.js +1 -0
- package/components/locale/vi.js +1 -0
- package/components/locale/zh-CN.js +1 -0
- package/components/locale/zh-TW.js +1 -0
- package/components/menu/demo/collapsed.md +9 -9
- package/components/menu/index.md +1 -0
- package/components/message/group.jsx +11 -4
- package/components/rate/rate.jsx +7 -2
- package/components/rate/star.jsx +20 -5
- package/components/select/select.jsx +5 -3
- package/components/slider/demo/vertical.md +2 -1
- package/components/slider/demo/withNumber.md +0 -2
- package/components/slider/index.md +2 -3
- package/components/slider/slider.jsx +296 -291
- package/components/slider/styles/index.less +11 -12
- package/components/slider/thumb.jsx +70 -148
- package/components/spin/demo/container.md +1 -1
- package/components/spin/demo/mode.md +1 -1
- package/components/statCard/countup.js +254 -0
- package/components/statCard/countup.jsx +45 -0
- package/components/statCard/demo/basic.md +31 -0
- package/components/statCard/demo/card.md +40 -0
- package/components/statCard/demo/index.jsx +19 -0
- package/components/statCard/demo/info.md +9 -0
- package/components/statCard/demo/with-card.md +43 -0
- package/components/statCard/index.js +3 -0
- package/components/statCard/index.md +28 -0
- package/components/statCard/rollup.jsx +64 -0
- package/components/statCard/statCard.jsx +42 -0
- package/components/statCard/statNumber.jsx +53 -0
- package/components/statCard/styles/index.less +76 -0
- package/components/styles/color.less +4 -2
- package/components/styles/index.less +1 -0
- package/components/styles/sys.less +2 -3
- package/components/styles/var.less +1 -0
- package/components/table/demo/col-row-span.md +1 -1
- package/components/table/demo/fixed-col-head.md +1 -1
- package/components/table/demo/head-span.md +2 -2
- package/components/table/demo/size.md +1 -1
- package/components/table/demo/table-check.md +11 -1
- package/components/table/index.md +13 -12
- package/components/table/styles/index.less +67 -58
- package/components/table/table.jsx +7 -5
- package/components/tabs/demo/sample.md +1 -8
- package/components/tabs/index.md +9 -9
- package/components/tabs/tabs.jsx +6 -4
- package/components/treeselect/treeselect.jsx +5 -3
- package/components/upload/demo/custom.md +5 -2
- package/components/upload/demo/exceed.md +1 -1
- package/components/upload/demo/pictures.md +14 -0
- package/components/upload/fileList.jsx +24 -47
- package/components/upload/index.md +13 -4
- package/components/upload/selector.jsx +37 -117
- package/components/upload/styles/index.less +2 -3
- package/components/upload/upload.jsx +189 -116
- package/components/utils/number.js +79 -65
- package/components/utils/placement.js +4 -4
- package/dist/k-ui.cjs.js +2 -2
- package/dist/k-ui.css +2 -2
- package/dist/k-ui.d.ts +160 -118
- package/dist/k-ui.esm.js +2 -2
- package/dist/k-ui.umd.js +2 -2
- package/dist/locale/de.js +2 -2
- package/dist/locale/el.js +2 -2
- package/dist/locale/en.js +2 -2
- package/dist/locale/fr.js +2 -2
- package/dist/locale/it.js +2 -2
- package/dist/locale/ja.js +2 -2
- package/dist/locale/ko.js +2 -2
- package/dist/locale/ru.js +2 -2
- package/dist/locale/th.js +2 -2
- package/dist/locale/ua.js +2 -2
- package/dist/locale/uk.js +2 -2
- package/dist/locale/vi.js +2 -2
- package/dist/locale/zh-CN.js +2 -2
- package/dist/locale/zh-TW.js +2 -2
- package/package.json +3 -1
- package/types/index.d.ts +14 -10
- package/types/rate/Rate.d.ts +1 -1
- package/types/slider/Slider.d.ts +7 -6
- package/types/statCard/StatCard.d.ts +20 -0
- package/types/statCard/StatNumber.d.ts +26 -0
- package/types/table/Table.d.ts +1 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Info from "./info.md";
|
|
2
|
+
import Basic from './basic.md';
|
|
3
|
+
import Card from './card.md';
|
|
4
|
+
import WithCard from './with-card.md';
|
|
5
|
+
|
|
6
|
+
import CN from "../index.md";
|
|
7
|
+
export default {
|
|
8
|
+
render() {
|
|
9
|
+
return (
|
|
10
|
+
<div>
|
|
11
|
+
<Info />
|
|
12
|
+
<Card />
|
|
13
|
+
<Basic />
|
|
14
|
+
<WithCard />
|
|
15
|
+
<CN />
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
},
|
|
19
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<cn>
|
|
2
|
+
### 奇奇怪怪的卡片
|
|
3
|
+
</cn>
|
|
4
|
+
|
|
5
|
+
```vue
|
|
6
|
+
<template>
|
|
7
|
+
<Space vertical class="demo-back">
|
|
8
|
+
<Card :bordered="false">
|
|
9
|
+
<StatNumber
|
|
10
|
+
v-model="value"
|
|
11
|
+
prefix="$"
|
|
12
|
+
suffix="%"
|
|
13
|
+
style="font-size: 2em;"
|
|
14
|
+
/>
|
|
15
|
+
</Card>
|
|
16
|
+
<Card :bordered="false" title="今日趋势">
|
|
17
|
+
<StatNumber v-model="value" suffix="%" style="font-size: 2em;color:green">
|
|
18
|
+
<template #prefix><Icon :type="ArrowUp" /></template>
|
|
19
|
+
</StatNumber>
|
|
20
|
+
</Card>
|
|
21
|
+
<Card :bordered="false" title="昨日趋势">
|
|
22
|
+
<StatNumber
|
|
23
|
+
v-model="value"
|
|
24
|
+
suffix="%"
|
|
25
|
+
style="font-size: 2em;color: red;"
|
|
26
|
+
type="rollup"
|
|
27
|
+
>
|
|
28
|
+
<template #prefix><Icon :type="ArrowDown" /></template>
|
|
29
|
+
</StatNumber>
|
|
30
|
+
</Card>
|
|
31
|
+
|
|
32
|
+
<Button @click="change">change</Button>
|
|
33
|
+
</Space>
|
|
34
|
+
</template>
|
|
35
|
+
<script setup>
|
|
36
|
+
import { ref } from "vue";
|
|
37
|
+
import { ArrowUp, ArrowDown } from "kui-icons";
|
|
38
|
+
const value = ref(Math.random() * 100000);
|
|
39
|
+
const change = () => {
|
|
40
|
+
value.value = Math.random() * 100000;
|
|
41
|
+
};
|
|
42
|
+
</script>
|
|
43
|
+
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
## StatCard API
|
|
2
|
+
|
|
3
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
4
|
+
| ----- | ------------ | ----------------- | --------- |
|
|
5
|
+
| title | 卡片标题 | String | - |
|
|
6
|
+
| items | 展示的数据 | Array | [] |
|
|
7
|
+
| statNumberType | 数值变化类型 | `rollup, countup` | 'countup' |
|
|
8
|
+
|
|
9
|
+
### items Options
|
|
10
|
+
|
|
11
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
12
|
+
| -------- | -------------------- | ------ | ------ |
|
|
13
|
+
| value | 数值 | Number | - |
|
|
14
|
+
| desc | 数值描述 | String | [] |
|
|
15
|
+
| prefix | 数值的前置内容 | String | - |
|
|
16
|
+
| suffix | 数值的后置内容 | String | - |
|
|
17
|
+
| duration | 数值动态展示时间(秒) | Number | 1.2 |
|
|
18
|
+
|
|
19
|
+
## StatNumber API
|
|
20
|
+
|
|
21
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
22
|
+
| --------- | -------------------- | ----------------- | --------- |
|
|
23
|
+
| value | 数值 | Number | - |
|
|
24
|
+
| duration | 数值动态展示时间(秒) | Number | 1.2 |
|
|
25
|
+
| prefix | 数值的前置内容 | String | - |
|
|
26
|
+
| suffix | 数值的后置内容 | String | - |
|
|
27
|
+
| precision | 数值精度 | Number | 0 |
|
|
28
|
+
| type | 数值变化类型 | `rollup, countup` | 'countup' |
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { defineComponent, onMounted, ref, watch } from "vue";
|
|
2
|
+
|
|
3
|
+
export default defineComponent({
|
|
4
|
+
name: "RollUp",
|
|
5
|
+
props: {
|
|
6
|
+
value: { type: [Number, String], default: 0 },
|
|
7
|
+
duration: { type: Number, default: 1.2 },
|
|
8
|
+
precision: { type: Number, default: 0 },
|
|
9
|
+
},
|
|
10
|
+
setup(props) {
|
|
11
|
+
const displayChars = ref([]);
|
|
12
|
+
const format = (val) => {
|
|
13
|
+
return new Intl.NumberFormat("en-US", {
|
|
14
|
+
minimumFractionDigits: props.precision,
|
|
15
|
+
maximumFractionDigits: props.precision,
|
|
16
|
+
})
|
|
17
|
+
.format(val)
|
|
18
|
+
.split("");
|
|
19
|
+
};
|
|
20
|
+
const getChars = (targetValue) => {
|
|
21
|
+
const finalChars = format(targetValue);
|
|
22
|
+
return finalChars.map((char) =>
|
|
23
|
+
/\d/.test(char) ? (char > 5 ? char - 5 : char * 1 + 5) : char
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
displayChars.value = getChars(props.value);
|
|
28
|
+
|
|
29
|
+
onMounted(() => {
|
|
30
|
+
displayChars.value = format(props.value);
|
|
31
|
+
});
|
|
32
|
+
watch(
|
|
33
|
+
() => props.value,
|
|
34
|
+
(newVal) => {
|
|
35
|
+
displayChars.value = format(newVal);
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
const numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
40
|
+
return () => (
|
|
41
|
+
<div class="k-stat-roll-number-container">
|
|
42
|
+
{displayChars.value.map((char, index) => (
|
|
43
|
+
<div key={index} class="k-stat-roll-number-slot">
|
|
44
|
+
{/\d/.test(char) ? (
|
|
45
|
+
<div
|
|
46
|
+
class="k-stat-roll-number-column"
|
|
47
|
+
style={{
|
|
48
|
+
transition: `transform ${props.duration * 1000}ms cubic-bezier(0.4, 0, 0.2, 1)`,
|
|
49
|
+
transform: `translateY(-${Number(char) * 10}%)`,
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
{numbers.map((num) => (
|
|
53
|
+
<span key={num}>{num}</span>
|
|
54
|
+
))}
|
|
55
|
+
</div>
|
|
56
|
+
) : (
|
|
57
|
+
<span class="k-stat-roll-number-separator">{char}</span>
|
|
58
|
+
)}
|
|
59
|
+
</div>
|
|
60
|
+
))}
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
},
|
|
64
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { defineComponent } from "vue";
|
|
2
|
+
import { withInstall } from "../utils/vue.js";
|
|
3
|
+
import StatNumber from "./statNumber.jsx";
|
|
4
|
+
|
|
5
|
+
const StatCard = defineComponent({
|
|
6
|
+
name: "StatCard",
|
|
7
|
+
props: {
|
|
8
|
+
title: String,
|
|
9
|
+
items: { type: Array, default: () => [] },
|
|
10
|
+
statNumberType: String,
|
|
11
|
+
},
|
|
12
|
+
setup(props, { slots }) {
|
|
13
|
+
return () => {
|
|
14
|
+
return (
|
|
15
|
+
<div class="k-stat-card">
|
|
16
|
+
<div class="k-stat-card-title">{props.title}</div>
|
|
17
|
+
<div class="k-stat-card-items">
|
|
18
|
+
{(props.items || []).map((item, index) => {
|
|
19
|
+
return (
|
|
20
|
+
<div key={index} class="k-stat-card-item">
|
|
21
|
+
<div class="k-stat-card-item-value">
|
|
22
|
+
<StatNumber
|
|
23
|
+
scopedSlots={{
|
|
24
|
+
prefix: () => item.prefix || slots.prefix,
|
|
25
|
+
suffix: () => item.suffix || slots.suffix,
|
|
26
|
+
}}
|
|
27
|
+
value={item.value}
|
|
28
|
+
duration={item.duration}
|
|
29
|
+
type={props.statNumberType}
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="k-stat-card-item-desc">{item.desc}</div>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
})}
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
export default withInstall(StatCard);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defineComponent } from "vue";
|
|
2
|
+
import { withInstall } from "../utils/vue.js";
|
|
3
|
+
import CountUp from "./countup.jsx";
|
|
4
|
+
import RollUp from "./rollup.jsx";
|
|
5
|
+
const StatNumber = defineComponent({
|
|
6
|
+
name: "StatNumber",
|
|
7
|
+
props: {
|
|
8
|
+
value: {
|
|
9
|
+
type: Number,
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
separator: String,
|
|
13
|
+
duration: {
|
|
14
|
+
type: Number,
|
|
15
|
+
default: 1,
|
|
16
|
+
},
|
|
17
|
+
precision: { type: Number, default: 0 },
|
|
18
|
+
type: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "countup",
|
|
21
|
+
validator: (val) => ["rollup", "countup"].includes(val),
|
|
22
|
+
},
|
|
23
|
+
prefix: String,
|
|
24
|
+
suffix: String,
|
|
25
|
+
},
|
|
26
|
+
setup(props, { slots }) {
|
|
27
|
+
return () => {
|
|
28
|
+
const items = {
|
|
29
|
+
props: {
|
|
30
|
+
value: props.value,
|
|
31
|
+
separator: props.separator,
|
|
32
|
+
duration: props.duration,
|
|
33
|
+
precision: props.precision,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
const prefixNode = props.prefix || slots.prefix?.();
|
|
37
|
+
const suffixNode = props.suffix || slots.suffix?.();
|
|
38
|
+
return (
|
|
39
|
+
<div class="k-stat-number">
|
|
40
|
+
{prefixNode && <span class="k-stat-number-prefix">{prefixNode}</span>}
|
|
41
|
+
{props.type === "rollup" ? (
|
|
42
|
+
<RollUp {...items} />
|
|
43
|
+
) : (
|
|
44
|
+
<CountUp {...items} />
|
|
45
|
+
)}
|
|
46
|
+
{suffixNode && <span class="k-stat-number-suffix">{suffixNode}</span>}
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export default withInstall(StatNumber);
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
.k-stat-card {
|
|
2
|
+
background-color: var(--kui-color-gray-90);
|
|
3
|
+
border-radius: var(--kui-border-card-radius);
|
|
4
|
+
width: 100%;
|
|
5
|
+
padding: 16px;
|
|
6
|
+
line-height: 1;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
}
|
|
9
|
+
.k-stat-card-title {
|
|
10
|
+
margin-bottom: 16px;
|
|
11
|
+
font-size: 16px;
|
|
12
|
+
font-weight: 600;
|
|
13
|
+
}
|
|
14
|
+
.k-stat-card-items {
|
|
15
|
+
display: flex;
|
|
16
|
+
gap: 8px;
|
|
17
|
+
}
|
|
18
|
+
.k-stat-card-item {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
gap: 8px;
|
|
22
|
+
flex: 1;
|
|
23
|
+
}
|
|
24
|
+
.k-stat-card-item-value {
|
|
25
|
+
font-size: 20px;
|
|
26
|
+
font-weight: 600;
|
|
27
|
+
}
|
|
28
|
+
.k-stat-card-item-desc {
|
|
29
|
+
color: var(--kui-color-gray-30);
|
|
30
|
+
font-size: 12px;
|
|
31
|
+
}
|
|
32
|
+
.k-stat-number {
|
|
33
|
+
font-family: monospace;
|
|
34
|
+
display: inline-flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
line-height: 1;
|
|
37
|
+
}
|
|
38
|
+
.k-stat-roll-number-container {
|
|
39
|
+
display: inline-flex;
|
|
40
|
+
line-height: 1;
|
|
41
|
+
height: 1em;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
font-variant-numeric: tabular-nums;
|
|
44
|
+
.k-stat-roll-number-slot {
|
|
45
|
+
position: relative;
|
|
46
|
+
display: inline-block;
|
|
47
|
+
height: 1em;
|
|
48
|
+
}
|
|
49
|
+
.k-stat-roll-number-column {
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
}
|
|
53
|
+
.k-stat-roll-number-column span,
|
|
54
|
+
.k-stat-roll-number-separator {
|
|
55
|
+
display: inline-block;
|
|
56
|
+
height: 1em;
|
|
57
|
+
width: 0.6em;
|
|
58
|
+
text-align: center;
|
|
59
|
+
}
|
|
60
|
+
.k-stat-roll-number-separator {
|
|
61
|
+
// width: 0.3em;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
.k-stat-number-suffix {
|
|
65
|
+
margin-left: 4px;
|
|
66
|
+
display: inline-flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
line-height: 1;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.k-stat-number-prefix {
|
|
72
|
+
margin-right: 4px;
|
|
73
|
+
display: inline-flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
line-height: 1;
|
|
76
|
+
}
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
@import '../slider/styles/index.less';
|
|
43
43
|
@import '../spin/styles/index.less';
|
|
44
44
|
@import '../switch/styles/index.less';
|
|
45
|
+
@import '../statCard/styles/index.less';
|
|
45
46
|
// @import '../steps/styles/index.less';
|
|
46
47
|
@import '../timeline/styles/index.less';
|
|
47
48
|
@import '../tag/styles/index.less';
|
|
@@ -18,7 +18,6 @@ textarea::placeholder {
|
|
|
18
18
|
}
|
|
19
19
|
.k-scroll {
|
|
20
20
|
&::-webkit-scrollbar {
|
|
21
|
-
// background-color: var(--kui-color-back);
|
|
22
21
|
width: 10px;
|
|
23
22
|
height: 10px;
|
|
24
23
|
}
|
|
@@ -38,11 +37,11 @@ textarea::placeholder {
|
|
|
38
37
|
|
|
39
38
|
&::-webkit-scrollbar-corner,
|
|
40
39
|
::-webkit-resizer {
|
|
41
|
-
background-color: transparent
|
|
40
|
+
background-color: transparent;
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
&::-webkit-scrollbar-track {
|
|
45
|
-
background-color: transparent
|
|
44
|
+
background-color: transparent;
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
|
|
@@ -27,7 +27,7 @@ const columns = [
|
|
|
27
27
|
{
|
|
28
28
|
title: "Name",
|
|
29
29
|
key: "name",
|
|
30
|
-
width:
|
|
30
|
+
width: 120,
|
|
31
31
|
fixed: "left",
|
|
32
32
|
},
|
|
33
33
|
{
|
|
@@ -80,7 +80,7 @@ const columns = [
|
|
|
80
80
|
{
|
|
81
81
|
title: "Gender",
|
|
82
82
|
key: "gender",
|
|
83
|
-
width:
|
|
83
|
+
width: 85,
|
|
84
84
|
fixed: "right",
|
|
85
85
|
},
|
|
86
86
|
];
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
<cn>
|
|
2
2
|
### 勾选
|
|
3
3
|
`checkable=true`,即可自动开启多选功能。
|
|
4
|
+
注意: 默认勾选的依赖为 `key` , 可以通过 `rowKey` 属性进行自定义。 如: `rowKey="ID"`
|
|
4
5
|
</cn>
|
|
5
6
|
|
|
6
7
|
```vue
|
|
7
8
|
<template>
|
|
8
|
-
<
|
|
9
|
+
<code>selectedKeys: {{ selectedKeys }}</code>
|
|
10
|
+
<Table
|
|
11
|
+
:data="data"
|
|
12
|
+
:columns="columns"
|
|
13
|
+
ref="selection"
|
|
14
|
+
checkable
|
|
15
|
+
:selectedKeys.sync="selectedKeys"
|
|
16
|
+
>
|
|
9
17
|
<template #tags="{ value }">
|
|
10
18
|
<Space>
|
|
11
19
|
<Tag
|
|
@@ -24,6 +32,8 @@
|
|
|
24
32
|
</Table>
|
|
25
33
|
</template>
|
|
26
34
|
<script setup>
|
|
35
|
+
import { ref } from "vue";
|
|
36
|
+
const selectedKeys = ref([]);
|
|
27
37
|
const data = [
|
|
28
38
|
{
|
|
29
39
|
key: "0",
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
## Table API
|
|
2
2
|
|
|
3
|
-
| 属性
|
|
4
|
-
|
|
|
5
|
-
| bordered
|
|
6
|
-
| checkable
|
|
7
|
-
|
|
|
8
|
-
| size
|
|
9
|
-
| emptyText
|
|
10
|
-
| loading
|
|
11
|
-
| data
|
|
12
|
-
| columns
|
|
13
|
-
|
|
|
14
|
-
|
|
|
3
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
4
|
+
| ------------ | ------------------------- | --------------------- | ---------- |
|
|
5
|
+
| bordered | 是否显示边框 | Boolean | false |
|
|
6
|
+
| checkable | 是否显示勾选框 | Boolean | false |
|
|
7
|
+
| selectedKeys | 勾选的key集合 | Array | false |
|
|
8
|
+
| size | 值为`small`时展示紧凑模式 | String | - |
|
|
9
|
+
| emptyText | 没有数据时展示的提示 | String | '赞无数据' |
|
|
10
|
+
| loading | 表格异步加载模式 | Boolean | false |
|
|
11
|
+
| data | 显示的结构化数据 | Array | [ ] |
|
|
12
|
+
| columns | 表格列的配置描述, | Array | [ ] |
|
|
13
|
+
| rowKey | 勾选时的依据 | String | key |
|
|
14
|
+
| onRowClick | 单击某一行时触发 | Function | - |
|
|
15
|
+
| onSort | 点击排序时触发 | Function({key,order}) | - |
|
|
15
16
|
|
|
16
17
|
## Column API
|
|
17
18
|
|