kui-vue 3.2.3 → 3.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +0 -0
- package/components/affix/affix.jsx +23 -75
- package/components/affix/demo/container.md +14 -7
- package/components/affix/index.md +6 -5
- package/components/anchor/demo/base.md +11 -11
- package/components/anchor/demo/index.vue +16 -16
- package/components/anchor/demo/info.md +6 -6
- package/components/anchor/index.js +2 -2
- package/components/anchor/index.md +3 -3
- package/components/avatar/avatar.jsx +63 -0
- package/components/avatar/demo/base.md +24 -0
- package/components/avatar/demo/change.md +40 -0
- package/components/avatar/demo/index.vue +20 -0
- package/components/avatar/demo/info.md +7 -0
- package/components/avatar/demo/types.md +23 -0
- package/components/avatar/index.js +2 -0
- package/components/avatar/index.md +7 -0
- package/components/avatar/styles/index.less +61 -0
- package/components/checkbox/styles/index.less +5 -1
- package/components/drawer/demo/target.md +0 -0
- package/components/icon/lib/dist.json +0 -0
- package/components/icon/lib/kui-icons.js +0 -0
- package/components/index.js +7 -1
- package/components/loading/demo/index.vue +17 -17
- package/components/loading/demo/info.md +54 -54
- package/components/loading/index.md +7 -7
- package/components/radio/styles/index.less +4 -1
- package/components/rate/demo/base.md +11 -11
- package/components/rate/demo/index.vue +29 -29
- package/components/rate/demo/info.md +7 -7
- package/components/rate/index.js +1 -1
- package/components/rate/index.md +11 -11
- package/components/rate/rate.jsx +93 -93
- package/components/slider/demo/base.md +35 -0
- package/components/slider/demo/index.vue +18 -0
- package/components/slider/demo/info.md +7 -0
- package/components/slider/demo/vertical.md +13 -0
- package/components/slider/index.md +7 -0
- package/components/slider/slider.jsx +58 -0
- package/components/slider/styles/index.less +60 -32
- package/components/space/demo/align.md +46 -0
- package/components/space/demo/base.md +20 -0
- package/components/space/demo/custom-size.md +35 -0
- package/components/space/demo/index.vue +25 -0
- package/components/space/demo/info.md +11 -0
- package/components/space/demo/size.md +35 -0
- package/components/space/demo/vertical.md +19 -0
- package/components/space/index.js +2 -0
- package/components/space/index.md +6 -0
- package/components/space/space.jsx +57 -0
- package/components/space/styles/index.less +23 -0
- package/components/styles/dark.less +3 -0
- package/components/styles/global-dark.less +35 -35
- package/components/styles/index.less +3 -0
- package/components/table/demo/base-render.md +1 -1
- package/components/table/demo/base.md +5 -2
- package/components/table/table.jsx +10 -7
- package/dist/k-ui-dark.css +1 -1
- package/dist/k-ui.css +1 -1
- package/dist/k-ui.js +2 -2
- package/package.json +3 -2
- package/components/slider/demo/slider.js +0 -5
- package/components/slider/slider.vue +0 -21
- package/components/slider/sliderButton.vue +0 -76
package/LICENSE
CHANGED
|
File without changes
|
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
import resize from '../_tool/resize'
|
|
3
3
|
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
top = element.offsetTop - element.parentElement.offsetTop
|
|
12
|
-
}
|
|
13
|
-
return {
|
|
14
|
-
top, height, width, scrollTop,
|
|
15
|
-
targetTop: targetRect.top,
|
|
16
|
-
targetHeight: targetRect.height,
|
|
17
|
-
targetInnerHeight: target.innerHeight || target.clientHeight
|
|
18
|
-
}
|
|
19
|
-
}
|
|
4
|
+
// function getStyle(el, attr) {
|
|
5
|
+
// if (el.currentStyle) {
|
|
6
|
+
// return el.currentStyle[attr];
|
|
7
|
+
// } else {
|
|
8
|
+
// return getComputedStyle(el, false)[attr];
|
|
9
|
+
// }
|
|
10
|
+
// }
|
|
20
11
|
|
|
21
12
|
export default {
|
|
22
13
|
name: 'Affix',
|
|
@@ -31,10 +22,7 @@ export default {
|
|
|
31
22
|
fixed: false,
|
|
32
23
|
width: 0,
|
|
33
24
|
height: 0,
|
|
34
|
-
|
|
35
|
-
offsetModeOfBottom: false,
|
|
36
|
-
offsetTopValue: this.offsetTop,
|
|
37
|
-
offsetBottomValue: this.offsetBottom
|
|
25
|
+
offsetTopValue: 0,
|
|
38
26
|
}
|
|
39
27
|
},
|
|
40
28
|
|
|
@@ -42,64 +30,29 @@ export default {
|
|
|
42
30
|
let target = this.target()
|
|
43
31
|
if (target) {
|
|
44
32
|
target.addEventListener('scroll', e => {
|
|
45
|
-
// console.log(e)
|
|
46
33
|
this.updatePosition(e)
|
|
47
|
-
// console.log(e)
|
|
48
34
|
})
|
|
49
35
|
}
|
|
50
|
-
// this.updatePosition(target)
|
|
51
36
|
},
|
|
52
37
|
methods: {
|
|
53
38
|
updatePosition(e) {
|
|
54
39
|
let { offsetBottom, offsetTop, $refs } = this
|
|
55
|
-
if (!$refs.blob) return;
|
|
56
|
-
|
|
57
40
|
let target = this.target()
|
|
41
|
+
if (!$refs.blob || !target) return;
|
|
58
42
|
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
offsetTop = target === window ? offsetTop : scrollTop
|
|
62
|
-
if (this.fixed) {
|
|
43
|
+
let rect = $refs.blob.getBoundingClientRect();
|
|
44
|
+
let rect2 = target != window && target != document ? target.getBoundingClientRect() : { top: 0, bottom: document.documentElement.clientHeight }
|
|
63
45
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
if (target !== window && top !== targetTop) {
|
|
76
|
-
this.offsetTopValue = targetTop
|
|
77
|
-
}
|
|
78
|
-
if (!this.fixed) {
|
|
79
|
-
this.fixed = false
|
|
80
|
-
this.$emit('change', false)
|
|
81
|
-
}
|
|
82
|
-
} else {
|
|
83
|
-
if (typeof offsetBottom != undefined && offsetBottom >= 0) {
|
|
84
|
-
//fixedBottom
|
|
85
|
-
if (0 <= top + height + offsetBottom - targetInnerHeight) {
|
|
86
|
-
this.offsetModeOfBottom = true
|
|
87
|
-
this.fixed = true
|
|
88
|
-
}
|
|
89
|
-
} else {
|
|
90
|
-
if (top <= offsetTop) { //fixedTop
|
|
91
|
-
this.fixed = true
|
|
92
|
-
this.offsetModeOfTop = true
|
|
93
|
-
if (target !== window) {
|
|
94
|
-
this.offsetTopValue = targetTop
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
if (this.fixed) {
|
|
99
|
-
this.$emit('change', true)
|
|
100
|
-
this.width = width
|
|
101
|
-
this.height = height
|
|
102
|
-
}
|
|
46
|
+
let hasbottom = typeof offsetBottom == 'number' && offsetBottom >= 0
|
|
47
|
+
let fx = hasbottom ? rect2.bottom - rect.bottom >= offsetBottom : rect.top - rect2.top <= offsetTop
|
|
48
|
+
if (!fx) {
|
|
49
|
+
this.offsetTopValue = rect.top
|
|
50
|
+
}
|
|
51
|
+
if (this.fixed != fx) {
|
|
52
|
+
this.fixed = fx
|
|
53
|
+
this.$emit('change', this.fixed)
|
|
54
|
+
this.width = rect.width
|
|
55
|
+
this.height = rect.height
|
|
103
56
|
}
|
|
104
57
|
}
|
|
105
58
|
},
|
|
@@ -112,13 +65,8 @@ export default {
|
|
|
112
65
|
}
|
|
113
66
|
fixedStyle = {
|
|
114
67
|
width: `${this.width}px`,
|
|
115
|
-
height: `${this.height}px
|
|
116
|
-
|
|
117
|
-
if (this.offsetModeOfBottom) {
|
|
118
|
-
fixedStyle.bottom = `${this.offsetBottom}px`
|
|
119
|
-
}
|
|
120
|
-
if (this.offsetModeOfTop) {
|
|
121
|
-
fixedStyle.top = `${this.offsetTopValue}px`
|
|
68
|
+
height: `${this.height}px`,
|
|
69
|
+
top: `${this.offsetTopValue}px`
|
|
122
70
|
}
|
|
123
71
|
classes = { ['k-affix']: this.fixed }
|
|
124
72
|
}
|
|
@@ -7,25 +7,32 @@
|
|
|
7
7
|
<template>
|
|
8
8
|
<div class="demo-affix-scroll" ref="container">
|
|
9
9
|
<div class="demo-affix-inner" >
|
|
10
|
-
<
|
|
10
|
+
<div style="padding:50px 0;" />
|
|
11
|
+
<Affix :target="() => this.$refs.container" :offsetTop="50">
|
|
11
12
|
<Button type="primary" id="tesss">Affix at the top of container</Button>
|
|
12
13
|
</Affix>
|
|
14
|
+
<div style="padding:200px 0;" />
|
|
15
|
+
<Affix :target="() => this.$refs.container" :offsetBottom="50">
|
|
16
|
+
<Button type="primary" id="tesss">Affix at the bottom of container</Button>
|
|
17
|
+
</Affix>
|
|
13
18
|
</div>
|
|
14
19
|
</div>
|
|
15
20
|
</template>
|
|
16
21
|
|
|
17
22
|
<style scoped>
|
|
18
23
|
.demo-affix-scroll{
|
|
19
|
-
height:
|
|
24
|
+
height:400px;
|
|
20
25
|
overflow-y:scroll;
|
|
26
|
+
background-image: linear-gradient(-45deg, #cdcdcd 25%, transparent 0), linear-gradient(45deg, #cdcdcd 25%, transparent 0), linear-gradient(-45deg, transparent 75%, #cdcdcd 0), linear-gradient(45deg, transparent 75%, #cdcdcd 0);
|
|
27
|
+
background-size: 20px 20px;
|
|
28
|
+
background-position: 0 0, 0 -10px, -10px 10px, 10px 0;
|
|
21
29
|
}
|
|
22
30
|
.demo-affix-inner{
|
|
23
|
-
height:
|
|
31
|
+
height:800px;
|
|
24
32
|
/* background:#efefef; */
|
|
25
|
-
padding-top:30px;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
background-position: 0 0, 0 -10px, -10px 10px, 10px 0;
|
|
33
|
+
/* padding-top:30px; */
|
|
34
|
+
|
|
35
|
+
|
|
29
36
|
}
|
|
30
37
|
</style>
|
|
31
38
|
```
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
## API
|
|
2
2
|
|
|
3
|
-
| 属性 | 说明
|
|
4
|
-
| ------------ |
|
|
5
|
-
| offsetTop | 距离窗口顶部达到指定偏移量后触发
|
|
6
|
-
| offsetBottom | 距离窗口底部达到指定偏移量后触发
|
|
7
|
-
| change | 在固定状态发生改变时触发, 返回当前固定状态 `false` , `true`
|
|
3
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
4
|
+
| ------------ | -------------------------------------------------------------------- | -------------- | ------ |
|
|
5
|
+
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | String, Number | 0 |
|
|
6
|
+
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | String, Number | - |
|
|
7
|
+
| change | 在固定状态发生改变时触发, 返回当前固定状态 `false` , `true` | Function | - |
|
|
8
|
+
| target | 设置 Affix 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 | HTMLElement | window |
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<cn>
|
|
2
|
-
#### 基本
|
|
3
|
-
最简单的用法。
|
|
4
|
-
</cn>
|
|
5
|
-
|
|
6
|
-
```vue
|
|
7
|
-
<template>
|
|
8
|
-
<div>
|
|
9
|
-
|
|
10
|
-
</div>
|
|
11
|
-
</template>
|
|
1
|
+
<cn>
|
|
2
|
+
#### 基本
|
|
3
|
+
最简单的用法。
|
|
4
|
+
</cn>
|
|
5
|
+
|
|
6
|
+
```vue
|
|
7
|
+
<template>
|
|
8
|
+
<div>
|
|
9
|
+
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
12
|
```
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import Info from './info.md'
|
|
3
|
-
import Base from './base.md'
|
|
4
|
-
import CN from '../index.md'
|
|
5
|
-
export default {
|
|
6
|
-
render() {
|
|
7
|
-
return (
|
|
8
|
-
<div>
|
|
9
|
-
<Info class="typo" />
|
|
10
|
-
<Base />
|
|
11
|
-
<CN class="typo" />
|
|
12
|
-
<div style="height:500px;text-align:center;color:#ddd;line-height:500px;">我是打酱油的,请忽略我...</div>
|
|
13
|
-
</div>
|
|
14
|
-
)
|
|
15
|
-
}
|
|
16
|
-
}
|
|
1
|
+
<script>
|
|
2
|
+
import Info from './info.md'
|
|
3
|
+
import Base from './base.md'
|
|
4
|
+
import CN from '../index.md'
|
|
5
|
+
export default {
|
|
6
|
+
render() {
|
|
7
|
+
return (
|
|
8
|
+
<div>
|
|
9
|
+
<Info class="typo" />
|
|
10
|
+
<Base />
|
|
11
|
+
<CN class="typo" />
|
|
12
|
+
<div style="height:500px;text-align:center;color:#ddd;line-height:500px;">我是打酱油的,请忽略我...</div>
|
|
13
|
+
</div>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
17
|
</script>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# Anchor锚点
|
|
2
|
-
用于跳转到页面指定位置。
|
|
3
|
-
|
|
4
|
-
## 何时使用
|
|
5
|
-
- 需要展现当前页面上可供跳转的锚点链接,以及快速在锚点之间跳转。
|
|
6
|
-
|
|
1
|
+
# Anchor锚点
|
|
2
|
+
用于跳转到页面指定位置。
|
|
3
|
+
|
|
4
|
+
## 何时使用
|
|
5
|
+
- 需要展现当前页面上可供跳转的锚点链接,以及快速在锚点之间跳转。
|
|
6
|
+
|
|
7
7
|
## 代码演示
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import Anchor from './anchor.jsx'
|
|
2
|
-
import Link from './link.jsx'
|
|
1
|
+
import Anchor from './anchor.jsx'
|
|
2
|
+
import Link from './link.jsx'
|
|
3
3
|
export { Anchor, Link }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## API
|
|
2
|
-
| 属性 | 说明 | 类型 | 默认值 |
|
|
3
|
-
|--------|-----------------------------|---------------|-----|
|
|
1
|
+
## API
|
|
2
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
3
|
+
|--------|-----------------------------|---------------|-----|
|
|
4
4
|
| height | 页面滚动高度达到该值时才显示 `BackTop` 组件 | String,Number | 400 |
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import Icon from '../icon'
|
|
2
|
+
import { getChild, isVnode } from '../_tool/utils'
|
|
3
|
+
export default {
|
|
4
|
+
props: {
|
|
5
|
+
icon: String,
|
|
6
|
+
shape: { type: String, },
|
|
7
|
+
size: {
|
|
8
|
+
type: [Number, String],
|
|
9
|
+
default: 'default',
|
|
10
|
+
validator: (val) => typeof val == 'number' ? 1 : ['large', 'small', 'default'].indexOf(val) >= 0
|
|
11
|
+
},
|
|
12
|
+
src: String
|
|
13
|
+
},
|
|
14
|
+
updated() {
|
|
15
|
+
this.udpateSize()
|
|
16
|
+
},
|
|
17
|
+
methods: {
|
|
18
|
+
udpateSize() {
|
|
19
|
+
let inner = this.$refs.inner
|
|
20
|
+
if (inner) {
|
|
21
|
+
let scale = 1, max = this.$el.offsetWidth - 8;
|
|
22
|
+
if (inner.scrollWidth > max)
|
|
23
|
+
scale = (max) / inner.scrollWidth
|
|
24
|
+
inner.style = 'transform: scale(' + scale + ') translateX(-50%);'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
mounted() {
|
|
29
|
+
this.udpateSize()
|
|
30
|
+
},
|
|
31
|
+
render() {
|
|
32
|
+
let { size, shape, src, icon } = this
|
|
33
|
+
let styles = {}
|
|
34
|
+
if (typeof size == 'number') {
|
|
35
|
+
styles = {
|
|
36
|
+
width: `${size}px`,
|
|
37
|
+
height: `${size}px`,
|
|
38
|
+
lineHeight: `${size}px`,
|
|
39
|
+
fontSize: `${size / 2}px`,
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
let child = getChild(this.$slots.default)
|
|
43
|
+
let hasIcon = child.filter(x => (x.componentOptions || {}).tag == 'Icon').length
|
|
44
|
+
let text = child.filter(x => !x.context).length == child.length
|
|
45
|
+
|
|
46
|
+
let cls = ['k-avatar', {
|
|
47
|
+
'k-avatar-lg': size == 'large',
|
|
48
|
+
'k-avatar-sm': size == 'small',
|
|
49
|
+
'k-avatar-image': src,
|
|
50
|
+
'k-avatar-icon': icon || hasIcon,
|
|
51
|
+
'k-avatar-square': shape == 'square'
|
|
52
|
+
}]
|
|
53
|
+
return <div class={cls} style={styles} >
|
|
54
|
+
{
|
|
55
|
+
icon ?
|
|
56
|
+
<Icon type={icon} /> :
|
|
57
|
+
(
|
|
58
|
+
src ? <img src={src} /> : (text ? <span class="k-avatar-string" ref="inner">{child}</span> : child)
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
</div >
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<cn>
|
|
2
|
+
#### 基本
|
|
3
|
+
头像有三种尺寸,两种形状可选。
|
|
4
|
+
</cn>
|
|
5
|
+
|
|
6
|
+
```vue
|
|
7
|
+
<template>
|
|
8
|
+
<div>
|
|
9
|
+
<div>
|
|
10
|
+
<Avatar :size="64" icon="person-outline" />
|
|
11
|
+
<Avatar size="large" icon="person-outline" />
|
|
12
|
+
<Avatar icon="person-outline" />
|
|
13
|
+
<Avatar size="small" icon="person-outline" />
|
|
14
|
+
</div>
|
|
15
|
+
<br />
|
|
16
|
+
<div>
|
|
17
|
+
<Avatar shape="square" :size="64" icon="person-outline" />
|
|
18
|
+
<Avatar shape="square" size="large" icon="person-outline" />
|
|
19
|
+
<Avatar shape="square" icon="person-outline" />
|
|
20
|
+
<Avatar shape="square" size="small" icon="person-outline" />
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<cn>
|
|
2
|
+
#### 自动调整字符大小
|
|
3
|
+
对于字符型的头像,当字符串较长时,字体大小可以根据头像宽度自动调整。
|
|
4
|
+
</cn>
|
|
5
|
+
|
|
6
|
+
```vue
|
|
7
|
+
<template>
|
|
8
|
+
<div>
|
|
9
|
+
<Avatar
|
|
10
|
+
size="large"
|
|
11
|
+
:style="{ backgroundColor: color, verticalAlign: 'middle' }"
|
|
12
|
+
>
|
|
13
|
+
{{ text }}
|
|
14
|
+
</Avatar>
|
|
15
|
+
<Button size="small" @click="changeValue">改变</Button>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
<script>
|
|
19
|
+
function ran(min, max) {
|
|
20
|
+
return parseInt((Math.random() * (max - min)) + min)
|
|
21
|
+
}
|
|
22
|
+
const userList = ['K', '王','邱先生', 'Jack', 'Jone'];
|
|
23
|
+
const colorList = ['#3a95ff', '#00bb5d', '#ff3300', '#ffa500'];
|
|
24
|
+
export default {
|
|
25
|
+
data() {
|
|
26
|
+
return {
|
|
27
|
+
text: userList[0],
|
|
28
|
+
color: colorList[0],
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
changeValue() {
|
|
33
|
+
this.text = userList[ran(0,3)]
|
|
34
|
+
this.color = colorList[ran(0,3)]
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import Info from './info.md'
|
|
3
|
+
import Base from './base.md'
|
|
4
|
+
import Types from './types.md'
|
|
5
|
+
import Change from './change.md'
|
|
6
|
+
import CN from '../index.md'
|
|
7
|
+
export default {
|
|
8
|
+
render() {
|
|
9
|
+
return (
|
|
10
|
+
<div>
|
|
11
|
+
<Info class="typo" />
|
|
12
|
+
<Base />
|
|
13
|
+
<Types />
|
|
14
|
+
<Change />
|
|
15
|
+
<CN class="typo" />
|
|
16
|
+
</div>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<cn>
|
|
2
|
+
#### 类型
|
|
3
|
+
支持三种类型:图片、Icon 以及字符,其中 Icon 和字符型可以自定义图标颜色及背景色。
|
|
4
|
+
</cn>
|
|
5
|
+
|
|
6
|
+
```vue
|
|
7
|
+
<template>
|
|
8
|
+
<div>
|
|
9
|
+
<Avatar icon="person-outline" />
|
|
10
|
+
<Avatar>
|
|
11
|
+
<Icon type="person-outline" />
|
|
12
|
+
</Avatar>
|
|
13
|
+
<Avatar>U</Avatar>
|
|
14
|
+
<Avatar>USER</Avatar>
|
|
15
|
+
<Avatar src="https://chuchur.com/img/icons/apple-icon-57x57.png" />
|
|
16
|
+
<Avatar style="color: #f51212; background-color: #ffc57d">
|
|
17
|
+
U
|
|
18
|
+
</Avatar>
|
|
19
|
+
<Avatar style="background-color:#d06868" icon="person-outline" />
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
```
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
## API
|
|
2
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
3
|
+
| ----- | ---------------------------- | -------------------------- | ------- |
|
|
4
|
+
| icon | 设置头像的图标类型 | String,Number | 400 |
|
|
5
|
+
| shape | 指定头像的形状 circle,square | String | circle |
|
|
6
|
+
| size | 设置头像的大小 | large,small,default,Number | default |
|
|
7
|
+
| src | 图片类头像的资源地址 | String | - |
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
@import '../../styles/global.less';
|
|
2
|
+
.k-avatar {
|
|
3
|
+
margin: 0;
|
|
4
|
+
padding: 0;
|
|
5
|
+
color: @back-color;
|
|
6
|
+
background-color: @border-color;
|
|
7
|
+
border-radius: 50%;
|
|
8
|
+
height: 32px;
|
|
9
|
+
width: 32px;
|
|
10
|
+
line-height: 32px;
|
|
11
|
+
text-align: center;
|
|
12
|
+
font-size: 14px;
|
|
13
|
+
white-space: nowrap;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
display: inline-block;
|
|
16
|
+
vertical-align: middle;
|
|
17
|
+
position: relative;
|
|
18
|
+
zoom: 1;
|
|
19
|
+
&>img {
|
|
20
|
+
display: block;
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
-o-object-fit: cover;
|
|
24
|
+
object-fit: cover;
|
|
25
|
+
}
|
|
26
|
+
&.k-avatar-icon {
|
|
27
|
+
font-size: 18px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.k-avatar-lg {
|
|
32
|
+
width: 40px;
|
|
33
|
+
height: 40px;
|
|
34
|
+
line-height: 40px;
|
|
35
|
+
&.k-avatar-icon {
|
|
36
|
+
font-size: 24px;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.k-avatar-sm {
|
|
41
|
+
width: 24px;
|
|
42
|
+
height: 24px;
|
|
43
|
+
line-height: 24px;
|
|
44
|
+
&.k-avatar-icon {
|
|
45
|
+
font-size: 14px;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.k-avatar-square {
|
|
50
|
+
border-radius: 4px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.k-avatar-image {
|
|
54
|
+
background-color: transparent;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.k-avatar-string {
|
|
58
|
+
position: absolute;
|
|
59
|
+
left: 50%;
|
|
60
|
+
transform-origin: 0 center;
|
|
61
|
+
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
user-select: none;
|
|
7
7
|
line-height: 1;
|
|
8
8
|
color: @color;
|
|
9
|
+
// margin-right: 16px;
|
|
9
10
|
.k-checkbox {
|
|
10
11
|
display: inline-block;
|
|
11
12
|
vertical-align: middle;
|
|
@@ -82,7 +83,7 @@
|
|
|
82
83
|
border-color: @main;
|
|
83
84
|
}
|
|
84
85
|
.k-checkbox-label {
|
|
85
|
-
padding:
|
|
86
|
+
padding-left: 8px;
|
|
86
87
|
vertical-align: middle;
|
|
87
88
|
}
|
|
88
89
|
}
|
|
@@ -118,4 +119,7 @@
|
|
|
118
119
|
|
|
119
120
|
.k-checkbox-group {
|
|
120
121
|
display: inline-block;
|
|
122
|
+
.k-checkbox-wrapper {
|
|
123
|
+
margin-right: 16px;
|
|
124
|
+
}
|
|
121
125
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/components/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Alert from './alert'
|
|
2
2
|
import Affix from './affix'
|
|
3
|
+
import Avatar from './avatar'
|
|
3
4
|
import { Breadcrumb, BreadcrumbItem } from './breadcrumb'
|
|
4
5
|
import Button from './button'
|
|
5
6
|
import Badge from './badge'
|
|
@@ -31,6 +32,8 @@ import Progress from './progress'
|
|
|
31
32
|
import { Radio, RadioGroup, RadioButton } from './radio'
|
|
32
33
|
import Rate from './rate'
|
|
33
34
|
import Spin from './spin'
|
|
35
|
+
import Space from './space'
|
|
36
|
+
import Slider from './slider'
|
|
34
37
|
import Switch from './switch'
|
|
35
38
|
import { Select, Option } from './select'
|
|
36
39
|
import Table from './table'
|
|
@@ -43,11 +46,12 @@ import { Row, Col } from './grid'
|
|
|
43
46
|
|
|
44
47
|
import { version } from '../package.json'
|
|
45
48
|
|
|
46
|
-
// import './styles';
|
|
49
|
+
// import './styles/index.less';
|
|
47
50
|
|
|
48
51
|
const components = {
|
|
49
52
|
Affix,
|
|
50
53
|
Alert,
|
|
54
|
+
Avatar,
|
|
51
55
|
BackTop,
|
|
52
56
|
Badge,
|
|
53
57
|
Breadcrumb, BreadcrumbItem,
|
|
@@ -79,7 +83,9 @@ const components = {
|
|
|
79
83
|
Progress,
|
|
80
84
|
Radio, RadioGroup, RadioButton,
|
|
81
85
|
Rate,
|
|
86
|
+
Space,
|
|
82
87
|
Spin,
|
|
88
|
+
Slider,
|
|
83
89
|
Select, Option,
|
|
84
90
|
Table,
|
|
85
91
|
Tabs, TabPane,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import Info from "./info";
|
|
3
|
-
import Base from "./base";
|
|
4
|
-
|
|
5
|
-
import CN from "../index.md";
|
|
6
|
-
export default {
|
|
7
|
-
render() {
|
|
8
|
-
return (
|
|
9
|
-
<div class="switch-demo">
|
|
10
|
-
<Info class="typo" />
|
|
11
|
-
<Base />
|
|
12
|
-
<CN class="typo" />
|
|
13
|
-
</div>
|
|
14
|
-
);
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
</script>
|
|
1
|
+
<script>
|
|
2
|
+
import Info from "./info";
|
|
3
|
+
import Base from "./base";
|
|
4
|
+
|
|
5
|
+
import CN from "../index.md";
|
|
6
|
+
export default {
|
|
7
|
+
render() {
|
|
8
|
+
return (
|
|
9
|
+
<div class="switch-demo">
|
|
10
|
+
<Info class="typo" />
|
|
11
|
+
<Base />
|
|
12
|
+
<CN class="typo" />
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
</script>
|