kui-vue 3.4.6 → 3.4.8
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/_tool/clone.js +1 -0
- package/components/avatar/demo/base.md +13 -15
- package/components/avatar/demo/change.md +2 -2
- package/components/avatar/demo/index.vue +1 -8
- package/components/avatar/demo/types.md +2 -2
- package/components/badge/badge.jsx +1 -0
- package/components/badge/demo/base.md +5 -5
- package/components/badge/demo/dot.md +1 -12
- package/components/badge/demo/dynamic.md +0 -11
- package/components/badge/demo/index.vue +14 -2
- package/components/badge/demo/mark.md +3 -3
- package/components/badge/demo/max.md +0 -12
- package/components/badge/demo/status.md +0 -5
- package/components/badge/styles/index.less +29 -2
- package/components/base/input.jsx +53 -27
- package/components/button/styles/index.less +4 -1
- package/components/checkbox/checkbox.jsx +1 -1
- package/components/checkbox/styles/index.less +13 -1
- package/components/colorPicker/colorpicker.jsx +59 -35
- package/components/colorPicker/demo/shape.md +1 -0
- package/components/colorPicker/index.md +1 -0
- package/components/colorPicker/styles/index.less +68 -56
- package/components/datePicker/datepicker.jsx +2 -1
- package/components/datePicker/demo/base.md +0 -3
- package/components/datePicker/styles/datepicker.less +1 -0
- package/components/drawer/drawer.jsx +1 -1
- package/components/dropdown/styles/index.less +4 -1
- package/components/form/demo/base.md +19 -2
- package/components/form/demo/length.md +1 -1
- package/components/form/demo/valid.md +21 -6
- package/components/form/form.jsx +4 -2
- package/components/form/formitem.jsx +3 -1
- package/components/form/styles/index.less +4 -2
- package/components/index.js +2 -0
- package/components/input/demo/base.md +2 -2
- package/components/input/demo/event.md +2 -2
- package/components/input/demo/group.md +20 -3
- package/components/input/demo/icon.md +8 -2
- package/components/input/demo/index.vue +1 -15
- package/components/input/demo/size.md +2 -2
- package/components/input/demo/suffix.md +63 -29
- package/components/input/demo/textarea.md +2 -2
- package/components/input/demo/theme.md +2 -4
- package/components/input/index.md +20 -10
- package/components/input/input.jsx +3 -0
- package/components/input/inputGroup.jsx +7 -4
- package/components/input/styles/index.less +104 -2
- package/components/input/textarea.jsx +1 -0
- package/components/inputNumber/demo/base.md +6 -12
- package/components/inputNumber/demo/ffix.md +3 -9
- package/components/inputNumber/inputNumber.jsx +9 -5
- package/components/inputNumber/styles/index.less +34 -20
- package/components/menu/styles/index.less +1 -1
- package/components/message/demo/close.md +2 -2
- package/components/message/demo/icon.md +2 -2
- package/components/message/demo/index.vue +1 -10
- package/components/message/demo/types.md +3 -3
- package/components/modal/demo/base.md +2 -2
- package/components/modal/demo/confrim.md +2 -2
- package/components/modal/demo/custom.md +2 -2
- package/components/modal/demo/global.md +2 -2
- package/components/modal/demo/index.vue +1 -10
- package/components/modal/demo/more.md +2 -2
- package/components/notice/demo/close.md +2 -2
- package/components/notice/demo/icon.md +2 -2
- package/components/notice/demo/index.vue +1 -10
- package/components/notice/demo/types.md +4 -4
- package/components/popconfirm/demo/index.vue +1 -10
- package/components/popconfirm/demo/local.md +17 -15
- package/components/popconfirm/demo/placement.md +50 -46
- package/components/poptip/demo/base.md +16 -14
- package/components/poptip/demo/index.vue +1 -10
- package/components/poptip/demo/placement.md +99 -94
- package/components/poptip/demo/trigger.md +16 -14
- package/components/poptip/styles/index.less +16 -0
- package/components/rate/demo/base.md +2 -5
- package/components/rate/demo/character.md +2 -4
- package/components/rate/demo/clear.md +2 -3
- package/components/rate/demo/custom.md +3 -5
- package/components/rate/demo/disabled.md +4 -8
- package/components/rate/demo/tips.md +2 -2
- package/components/select/styles/index.less +5 -1
- package/components/slider/styles/index.less +3 -3
- package/components/space/demo/compact.md +23 -6
- package/components/space/space.jsx +21 -24
- package/components/space/styles/index.less +5 -0
- package/components/styles/index.less +1 -0
- package/components/tooltip/demo/index.vue +1 -14
- package/components/tooltip/demo/placement.md +50 -46
- package/components/tree/demo/checkable.md +5 -1
- package/components/tree/demo/directory.md +27 -31
- package/components/tree/index.md +22 -15
- package/components/tree/node.jsx +43 -23
- package/components/tree/styles/index.less +257 -215
- package/components/tree/tree.jsx +39 -6
- package/components/treeselect/demo/base.md +59 -0
- package/components/treeselect/demo/checkable.md +59 -0
- package/components/treeselect/demo/index.vue +30 -0
- package/components/treeselect/demo/info.md +7 -0
- package/components/treeselect/demo/multiple.md +59 -0
- package/components/treeselect/demo/sync.md +38 -0
- package/components/treeselect/index.md +38 -0
- package/components/treeselect/styles/index.less +580 -27
- package/components/treeselect/treeselect.jsx +508 -0
- package/dist/k-ui.css +2 -2
- package/dist/k-ui.js +2 -2
- package/package.json +2 -1
- package/components/treeselect/treeselect.vue +0 -200
|
@@ -30,12 +30,9 @@
|
|
|
30
30
|
<Input />
|
|
31
31
|
</FormItem>
|
|
32
32
|
<FormItem label="Captcha" prop="captcha">
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<span v-else>{{time}}(s)</span>
|
|
37
|
-
</template>
|
|
38
|
-
</Input>
|
|
33
|
+
<Input>
|
|
34
|
+
<Button slot="suffix" :size="size" :disabled="time!=60" style="width:100px;" @click="sendCode">{{time==60?'获取验证码':time+'(s)'}}</Button>
|
|
35
|
+
</Input>
|
|
39
36
|
</FormItem>
|
|
40
37
|
<FormItem label="Country">
|
|
41
38
|
<FormItem prop="country">
|
|
@@ -52,6 +49,10 @@
|
|
|
52
49
|
</Select>
|
|
53
50
|
</FormItem>
|
|
54
51
|
</FormItem>
|
|
52
|
+
<FormItem label="TreeSelect" prop="tree">
|
|
53
|
+
<TreeSelect style="width:100%;" :tree-data="treeData">
|
|
54
|
+
</TreeSelect>
|
|
55
|
+
</FormItem>
|
|
55
56
|
<FormItem label="Slider" prop="slider">
|
|
56
57
|
<Slider />
|
|
57
58
|
</FormItem>
|
|
@@ -120,6 +121,15 @@ export default {
|
|
|
120
121
|
wrapperCol:{span:16},
|
|
121
122
|
time: 60,
|
|
122
123
|
size:'default',
|
|
124
|
+
treeData: [
|
|
125
|
+
{
|
|
126
|
+
title:'food',
|
|
127
|
+
key:'0',
|
|
128
|
+
children :[
|
|
129
|
+
{ title:'apple' ,key:'0-1' },
|
|
130
|
+
{ title:'orange' ,key:'0-2' },
|
|
131
|
+
]}
|
|
132
|
+
],
|
|
123
133
|
form: {
|
|
124
134
|
email: '',
|
|
125
135
|
number:'',
|
|
@@ -128,6 +138,7 @@ export default {
|
|
|
128
138
|
phone: '',
|
|
129
139
|
captcha: '',
|
|
130
140
|
slider:5,
|
|
141
|
+
tree:'',
|
|
131
142
|
gender: '',
|
|
132
143
|
one: false,
|
|
133
144
|
system:'',
|
|
@@ -167,6 +178,9 @@ export default {
|
|
|
167
178
|
country: [
|
|
168
179
|
{ required: true, message: '请选择国家' },
|
|
169
180
|
],
|
|
181
|
+
tree: [
|
|
182
|
+
{ required: true, message: '请选择Food' },
|
|
183
|
+
],
|
|
170
184
|
city: [
|
|
171
185
|
{ required: true, message: '请选择城市' },
|
|
172
186
|
],
|
|
@@ -217,6 +231,7 @@ export default {
|
|
|
217
231
|
gender: '1',
|
|
218
232
|
slider:5,
|
|
219
233
|
number:5,
|
|
234
|
+
tree:'0',
|
|
220
235
|
system: '0',
|
|
221
236
|
one: true,
|
|
222
237
|
birthday: '1995-05-05',
|
package/components/form/form.jsx
CHANGED
|
@@ -22,7 +22,8 @@ export default {
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
theme: String,
|
|
25
|
-
shape: String
|
|
25
|
+
shape: String,
|
|
26
|
+
disabled: Boolean
|
|
26
27
|
},
|
|
27
28
|
provide() {
|
|
28
29
|
return {
|
|
@@ -88,6 +89,7 @@ export default {
|
|
|
88
89
|
} else {
|
|
89
90
|
model[key] = value
|
|
90
91
|
}
|
|
92
|
+
// console.log(model[key],key)
|
|
91
93
|
}
|
|
92
94
|
model = model[key]
|
|
93
95
|
}
|
|
@@ -125,7 +127,7 @@ export default {
|
|
|
125
127
|
// throw new Error('请传入正确的prop值:' + path)
|
|
126
128
|
}
|
|
127
129
|
}
|
|
128
|
-
return model == this.model ? null : model;
|
|
130
|
+
return model == this.model || JSON.stringify(model) == '{}' ? null : model;
|
|
129
131
|
},
|
|
130
132
|
submit(e) {
|
|
131
133
|
e && e.preventDefault()
|
|
@@ -80,8 +80,9 @@ export default {
|
|
|
80
80
|
const size = (child.componentOptions && child.componentOptions.propsData.size) || this.Form.size
|
|
81
81
|
const theme = (child.componentOptions && child.componentOptions.propsData.theme) || this.Form.theme
|
|
82
82
|
const shape = (child.componentOptions && child.componentOptions.propsData.shape) || this.Form.shape
|
|
83
|
+
const disabled = (child.componentOptions && child.componentOptions.propsData.disabled) || this.Form.disabled
|
|
83
84
|
const props = {
|
|
84
|
-
props: { id, size },
|
|
85
|
+
props: { id, size, disabled },
|
|
85
86
|
on: {}
|
|
86
87
|
}
|
|
87
88
|
if (theme) {
|
|
@@ -95,6 +96,7 @@ export default {
|
|
|
95
96
|
props.props.checked = value || false
|
|
96
97
|
} else {
|
|
97
98
|
props.props.value = value
|
|
99
|
+
// console.log(value)
|
|
98
100
|
}
|
|
99
101
|
props.on = {
|
|
100
102
|
input: (value) => {
|
|
@@ -96,7 +96,8 @@
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
.k-select
|
|
99
|
+
.k-select,
|
|
100
|
+
.k-tree-select {
|
|
100
101
|
border-color: var(--kui-color-danger);
|
|
101
102
|
|
|
102
103
|
.k-select-arrow {
|
|
@@ -108,7 +109,8 @@
|
|
|
108
109
|
border-color: var(--kui-color-danger);
|
|
109
110
|
}
|
|
110
111
|
|
|
111
|
-
.k-select-open .k-select
|
|
112
|
+
.k-select-open .k-select,
|
|
113
|
+
.k-tree-select-open .k-tree-select {
|
|
112
114
|
box-shadow: 0 0 0 2px var(--kui-color-danger-90);
|
|
113
115
|
}
|
|
114
116
|
|
package/components/index.js
CHANGED
|
@@ -45,6 +45,7 @@ import Tooltip from './tooltip'
|
|
|
45
45
|
import { Tabs, TabPane } from './tabs'
|
|
46
46
|
import { TimeLine, TimeLineItem } from './timeline'
|
|
47
47
|
import { Tree, TreeNode } from './tree'
|
|
48
|
+
import TreeSelect from './treeselect'
|
|
48
49
|
import Tag from './tag'
|
|
49
50
|
import { Row, Col } from './grid'
|
|
50
51
|
import Upload from './upload'
|
|
@@ -103,6 +104,7 @@ const components = {
|
|
|
103
104
|
Tag,
|
|
104
105
|
Tooltip,
|
|
105
106
|
Tree, TreeNode,
|
|
107
|
+
TreeSelect,
|
|
106
108
|
Upload
|
|
107
109
|
}
|
|
108
110
|
const UI = {
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<
|
|
8
|
+
<Space vertical style="width:512px;" >
|
|
9
9
|
<Input placeholder="请输入内容..." @blur="blur" @focus="focus" @change="change" />
|
|
10
10
|
<Input placeholder="disabled..." disabled />
|
|
11
|
-
</
|
|
11
|
+
</Space>
|
|
12
12
|
</template>
|
|
13
13
|
<script>
|
|
14
14
|
export default{
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<
|
|
8
|
+
<Space vertical style="width:512px;">
|
|
9
9
|
<Input placeholder="请输入内容..."
|
|
10
10
|
clearable
|
|
11
11
|
@change="change"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
@blur="blur"
|
|
26
26
|
@focus="focus"
|
|
27
27
|
/>
|
|
28
|
-
</
|
|
28
|
+
</Space>
|
|
29
29
|
</template>
|
|
30
30
|
<script>
|
|
31
31
|
let events = {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<cn>
|
|
2
2
|
#### 输入框组合
|
|
3
|
-
使用
|
|
3
|
+
使用 InputGroup 让组件之间紧凑连接且合并边框。默认 true
|
|
4
4
|
</cn>
|
|
5
5
|
|
|
6
6
|
```vue
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
<InputNumber :value="12" />
|
|
53
53
|
</InputGroup>
|
|
54
54
|
<InputGroup>
|
|
55
|
-
<Input :style="{ width: '50%' }" value="input content" />
|
|
55
|
+
<Input :style="{ width: '50%' }" value="input content" :icon="Copy"/>
|
|
56
56
|
<DatePicker />
|
|
57
57
|
</InputGroup>
|
|
58
58
|
<InputGroup>
|
|
@@ -91,6 +91,13 @@
|
|
|
91
91
|
textAlig: 'center',
|
|
92
92
|
}" placeholder="Maximum" />
|
|
93
93
|
</InputGroup>
|
|
94
|
+
<InputGroup>
|
|
95
|
+
<Select value="Option1-1">
|
|
96
|
+
<Option value="Option1-1">Option1-1</Option>
|
|
97
|
+
<Option value="Option1-2">Option1-2</Option>
|
|
98
|
+
</Select>
|
|
99
|
+
<TreeSelect :tree-data="treeData" clearable style="width:200px"></TreeSelect>
|
|
100
|
+
</InputGroup>
|
|
94
101
|
</Space>
|
|
95
102
|
</template>
|
|
96
103
|
<script>
|
|
@@ -98,7 +105,17 @@ import { Copy } from 'kui-icons'
|
|
|
98
105
|
export default{
|
|
99
106
|
data(){
|
|
100
107
|
return{
|
|
101
|
-
Copy
|
|
108
|
+
Copy,
|
|
109
|
+
treeData:[
|
|
110
|
+
{
|
|
111
|
+
title:'fruit',
|
|
112
|
+
key:'1',
|
|
113
|
+
children:[
|
|
114
|
+
{title:'apple',key:'11'},
|
|
115
|
+
{title:'orange',key:'12'},
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
]
|
|
102
119
|
}
|
|
103
120
|
}
|
|
104
121
|
}
|
|
@@ -5,17 +5,23 @@
|
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<
|
|
8
|
+
<Space vertical style="width:512px;">
|
|
9
9
|
<Input placeholder="User Name..." :icon="Person" />
|
|
10
10
|
<Input type="password" placeholder="Password..." :icon="LockClosed" />
|
|
11
|
+
<Space compact block>
|
|
12
|
+
<Input type="password" placeholder="Password defalt text" :icon="LockClosed" :visiblePassword="visiblePassword" />
|
|
13
|
+
<Button @click="visiblePassword=!visiblePassword">Toggle</Button>
|
|
14
|
+
</Space>
|
|
15
|
+
<Input type="password" placeholder="Password no toggle" :icon="LockClosed" :visiblePasswordIcon="false" />
|
|
11
16
|
<Input placeholder="请输入关进行搜索键字..." @search="search"/>
|
|
12
|
-
</
|
|
17
|
+
</Space>
|
|
13
18
|
</template>
|
|
14
19
|
<script>
|
|
15
20
|
import { Person, LockClosed } from "kui-icons";
|
|
16
21
|
export default {
|
|
17
22
|
data() {
|
|
18
23
|
return {
|
|
24
|
+
visiblePassword:true,
|
|
19
25
|
Person, LockClosed
|
|
20
26
|
}
|
|
21
27
|
},
|
|
@@ -29,18 +29,4 @@ export default {
|
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
-
</script>
|
|
33
|
-
<style lang="less">
|
|
34
|
-
.demo-input {
|
|
35
|
-
.k-input,
|
|
36
|
-
.k-textarea {
|
|
37
|
-
margin-bottom: 10px;
|
|
38
|
-
}
|
|
39
|
-
.k-input-wrapper {
|
|
40
|
-
margin-bottom: 10px;
|
|
41
|
-
.k-input {
|
|
42
|
-
margin: 0;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
</style>
|
|
32
|
+
</script>
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<
|
|
8
|
+
<Space vertical style="width:512px;">
|
|
9
9
|
<Input placeholder="Large Input" size="large" :icon="LogoKui" clearable/>
|
|
10
10
|
<Input placeholder="Base Input" :icon="LogoKui" clearable />
|
|
11
11
|
<Input size="small" placeholder="Small Input" :icon="LogoKui" @icon-click="$Message.info('点击图标事件')" clearable />
|
|
12
|
-
</
|
|
12
|
+
</Space>
|
|
13
13
|
</template>
|
|
14
14
|
<script>
|
|
15
15
|
import { LogoKui } from 'kui-icons'
|
|
@@ -5,51 +5,85 @@ suffix,prefix 扩展
|
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<
|
|
9
|
-
<Input placeholder="请输入用户名" :icon="PersonOutline"/>
|
|
10
|
-
<Input placeholder="请输入验证码" :icon="ShieldCheckmark" :maxlength="8">
|
|
8
|
+
<Space vertical style="width:512px;">
|
|
9
|
+
<Input placeholder="请输入用户名" :icon="PersonOutline" />
|
|
10
|
+
<Input placeholder="请输入验证码" :icon="ShieldCheckmark" :maxlength="8" prefix="¥">
|
|
11
|
+
<template slot="suffix">
|
|
12
|
+
<Button :disabled="time!=60" style="width:100px;" @click="sendCode">{{time==60?'获取验证码':time+'(s)'}}</Button>
|
|
13
|
+
</template>
|
|
14
|
+
</Input>
|
|
15
|
+
<Input placeholder="请填写你要喝的Coffee" :icon="Gift">
|
|
16
|
+
<template slot="suffix">
|
|
17
|
+
<Tooltip title="请咨询管理员">
|
|
18
|
+
<Icon :type="InformationCircleOutline" color="orange" />
|
|
19
|
+
</Tooltip>
|
|
20
|
+
</template>
|
|
21
|
+
</Input>
|
|
22
|
+
<Input placeholder="请输入金额" suffix="RMB" prefix="¥" />
|
|
23
|
+
<Input placeholder="请输入域名" suffix=".com" prefix="https://" />
|
|
24
|
+
<Input placeholder="输入内容" prefix="www.">
|
|
25
|
+
<template slot="prefix">
|
|
26
|
+
<Select :options="options" clearable value="http"></Select>
|
|
27
|
+
</template>
|
|
11
28
|
<template slot="suffix">
|
|
12
|
-
<
|
|
13
|
-
<span v-else>{{time}}(s)</span>
|
|
29
|
+
<Select :options="list" clearable value=".com"></Select>
|
|
14
30
|
</template>
|
|
15
31
|
</Input>
|
|
16
|
-
<Input placeholder="
|
|
32
|
+
<Input placeholder="请输入金额" suffix=".00" />
|
|
33
|
+
<Input placeholder="输入内容" prefix="www.">
|
|
34
|
+
<template slot="prefix">
|
|
35
|
+
<Select :options="options" clearable value="http"></Select>
|
|
36
|
+
</template>
|
|
17
37
|
<template slot="suffix">
|
|
18
|
-
|
|
19
|
-
<Icon :type="InformationCircleOutline" color="orange"/>
|
|
20
|
-
</Tooltip>
|
|
38
|
+
<TreeSelect :tree-data="treeData" clearable style="width:200px"></TreeSelect>
|
|
21
39
|
</template>
|
|
22
40
|
</Input>
|
|
23
|
-
|
|
24
|
-
<Input placeholder="请输入域名" suffix=".com" prefix="https://"/>
|
|
25
|
-
<Input placeholder="请输入金额" suffix=".00"/>
|
|
26
|
-
</div>
|
|
41
|
+
</Space>
|
|
27
42
|
</template>
|
|
28
|
-
<script>
|
|
29
|
-
import { InformationCircleOutline, Gift, ShieldCheckmark
|
|
30
|
-
export default {
|
|
43
|
+
<script>
|
|
44
|
+
import { InformationCircleOutline, Gift, ShieldCheckmark, PersonOutline } from 'kui-icons'
|
|
45
|
+
export default {
|
|
31
46
|
data() {
|
|
32
47
|
return {
|
|
33
|
-
InformationCircleOutline, Gift, ShieldCheckmark
|
|
34
|
-
time:60,
|
|
35
|
-
timer:null
|
|
48
|
+
InformationCircleOutline, Gift, ShieldCheckmark, PersonOutline,
|
|
49
|
+
time: 60,
|
|
50
|
+
timer: null,
|
|
51
|
+
options: [
|
|
52
|
+
{ label: 'http', value: 'http' },
|
|
53
|
+
{ label: 'https', value: 'https' },
|
|
54
|
+
],
|
|
55
|
+
list: [
|
|
56
|
+
{ label: '.com', value: '.com' },
|
|
57
|
+
{ label: '.cn', value: '.cn' },
|
|
58
|
+
{ label: '.org', value: '.org' },
|
|
59
|
+
],
|
|
60
|
+
treeData:[
|
|
61
|
+
{
|
|
62
|
+
title:'fruit',
|
|
63
|
+
key:'1',
|
|
64
|
+
children:[
|
|
65
|
+
{title:'apple',key:'11'},
|
|
66
|
+
{title:'orange',key:'12'},
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
]
|
|
36
70
|
}
|
|
37
71
|
},
|
|
38
|
-
beforDestroy(){
|
|
72
|
+
beforDestroy() {
|
|
39
73
|
clearInterval(this.timer)
|
|
40
74
|
},
|
|
41
75
|
methods: {
|
|
42
|
-
sendCode(){
|
|
76
|
+
sendCode() {
|
|
43
77
|
this.time = 59
|
|
44
78
|
this.$Message.success("验证码发送成功,请注意查收");
|
|
45
|
-
this.timer = setInterval(e=>{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
},1000)
|
|
79
|
+
this.timer = setInterval(e => {
|
|
80
|
+
if (this.time <= 0) {
|
|
81
|
+
clearInterval(this.timer)
|
|
82
|
+
this.time = 60
|
|
83
|
+
} else {
|
|
84
|
+
this.time--
|
|
85
|
+
}
|
|
86
|
+
}, 1000)
|
|
53
87
|
}
|
|
54
88
|
}
|
|
55
89
|
};
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<
|
|
8
|
+
<Space vertical style="width:512px;">
|
|
9
9
|
<TextArea :rows="4" placeholder="请输入内容..." />
|
|
10
10
|
<TextArea :rows="2" placeholder="请输入内容..." />
|
|
11
11
|
<TextArea :rows="2" placeholder="disabled..." disabled />
|
|
12
|
-
</
|
|
12
|
+
</Space>
|
|
13
13
|
</template>
|
|
14
14
|
```
|
|
@@ -5,16 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<
|
|
8
|
+
<Space vertical style="width:512px;">
|
|
9
9
|
<Checkbox label="Circle" v-model="isShape"/>
|
|
10
|
-
<br/>
|
|
11
|
-
<br/>
|
|
12
10
|
<Input placeholder="请输入内容..." @blur="blur" @focus="focus" @change="change" theme="light" :shape="shape"/>
|
|
13
11
|
<Input placeholder="disabled..." disabled theme="light" :shape="shape"/>
|
|
14
12
|
<Input placeholder="请输入内容..." theme="light" :icon="Search" :shape="shape"/>
|
|
15
13
|
<Input placeholder="请输入内容..." theme="light" @search="focus" clearable :shape="shape"/>
|
|
16
14
|
<TextArea placeholder="请输入内容..." theme="light" :rows="3"/>
|
|
17
|
-
</
|
|
15
|
+
</Space>
|
|
18
16
|
</template>
|
|
19
17
|
<script>
|
|
20
18
|
import { Search } from "kui-icons";
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
## Input API
|
|
2
|
-
| 属性
|
|
3
|
-
|
|
|
4
|
-
| value
|
|
5
|
-
| size
|
|
6
|
-
| icon
|
|
7
|
-
| suffix
|
|
8
|
-
| prefix
|
|
9
|
-
| search
|
|
10
|
-
| theme
|
|
11
|
-
| clearable
|
|
2
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
3
|
+
| ------------------- | ------------------------------------------ | ---------------- | ------ |
|
|
4
|
+
| value | 绑定的值,可使用 `v-model` 双向绑定 | String 、 Number | - |
|
|
5
|
+
| size | 按钮尺寸,可选值 `small`、`large`,默认不选 | String | - |
|
|
6
|
+
| icon | 输入框图标 | String | - |
|
|
7
|
+
| suffix | 扩展后缀 | String,Slot | - |
|
|
8
|
+
| prefix | 扩展前缀 | String,Slot | - |
|
|
9
|
+
| search | 搜索事件的回调 | Function | right |
|
|
10
|
+
| theme | theme='light' 时呈现浅色主题 | String | right |
|
|
11
|
+
| clearable | 是否现示清除按钮 | Boolen | false |
|
|
12
|
+
| visiblePassword | 密码出事化明文显示 | Boolen | false |
|
|
13
|
+
| visiblePasswordIcon | 是否显示切换按钮或者控制密码显隐 | Boolen | true |
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## Input Group API
|
|
17
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
18
|
+
| ------- | ---------------------------------------------- | ------ | ------ |
|
|
19
|
+
| block | 是否继承父集宽度 | Boolen | false |
|
|
20
|
+
| compact | 是否使用紧促模式 | Boolen | false |
|
|
21
|
+
| size | 子组件的间距,可选值 `small`、`large`,默认不选 | String | - |
|
|
@@ -10,11 +10,11 @@ export default {
|
|
|
10
10
|
},
|
|
11
11
|
size: {
|
|
12
12
|
type: [String, Number, Array],
|
|
13
|
-
|
|
13
|
+
default: 'default',
|
|
14
14
|
validator(value) {
|
|
15
|
-
return (typeof value == 'number' || Array.isArray(value)) ? true : ["small", "middle", "large"].indexOf(value) >= 0;
|
|
15
|
+
return (typeof value == 'number' || Array.isArray(value)) ? true : ["small", "middle", "large", 'default'].indexOf(value) >= 0;
|
|
16
16
|
}
|
|
17
|
-
}
|
|
17
|
+
},
|
|
18
18
|
},
|
|
19
19
|
render() {
|
|
20
20
|
let { $slots, size, compact, block } = this
|
|
@@ -23,7 +23,9 @@ export default {
|
|
|
23
23
|
class: ['k-input-group', {
|
|
24
24
|
[`k-input-group-compact`]: compact,
|
|
25
25
|
[`k-input-group-block`]: block,
|
|
26
|
-
|
|
26
|
+
[`k-input-group-lg`]: size == 'large',
|
|
27
|
+
[`k-input-group-sm`]: size == 'small',
|
|
28
|
+
}],
|
|
27
29
|
}
|
|
28
30
|
if (!size && !compact) {
|
|
29
31
|
props.style.gap = '8px'
|
|
@@ -58,6 +60,7 @@ export default {
|
|
|
58
60
|
childs = newChilds
|
|
59
61
|
|
|
60
62
|
}
|
|
63
|
+
// console.log(props)
|
|
61
64
|
return <div {...props}>{childs}</div>
|
|
62
65
|
}
|
|
63
66
|
}
|