This commit is contained in:
maplemei 2019-12-18 18:35:14 +08:00
parent 2111c073b8
commit d9be71e259
3 changed files with 76 additions and 2 deletions

2
dist/static/2.js vendored

File diff suppressed because one or more lines are too long

View File

@ -22,6 +22,20 @@ var demo1 = xmSelect.render({
### 方块形状, 隐藏删除图标
```
model: {
label: {
type: 'block',
block: {
//最大显示数量, 0:不限制
showCount: 0,
//是否显示删除图标
showIcon: false,
}
}
},
```
:::demo
```html
@ -53,6 +67,20 @@ var demo2 = xmSelect.render({
### 方块形状, 超过1个隐藏
```
model: {
label: {
type: 'block',
block: {
//最大显示数量, 0:不限制
showCount: 1,
//是否显示删除图标
showIcon: true,
}
}
},
```
:::demo
```html
@ -84,6 +112,23 @@ var demo3 = xmSelect.render({
### 简单拼接形式
```
model: {
label: {
type: 'text',
//使用字符串拼接的方式
text: {
//左边拼接的字符
left: '【',
//右边拼接的字符
right: '】',
//中间的分隔符
separator: '',
},
}
},
```
:::demo
```html
@ -118,6 +163,19 @@ var demo4 = xmSelect.render({
### 自定义显示
```
model: {
label: {
type: 'xxxx', //自定义与下面的对应
xxxx: {
template(data, sels){
return "已选中 " + sels.length + " 项, 共 " + data.length + " 项"
}
},
}
},
```
:::demo
```html
@ -148,6 +206,20 @@ var demo5 = xmSelect.render({
### 自定义显示HTML
```
model: {
label: {
type: 'xxxx', //自定义与下面的对应
xxxx: {
template(data, sels){
//也可以是html
return `<div style="color: red;">${sels.length} / ${data.length}</div>`
}
},
}
},
```
:::demo
```html

View File

@ -132,7 +132,9 @@ model: {
return `已选中 ${sels.length} 项, 共 ${data.length} 项`
}
},
},
},
//展示类型, 下拉框形式: absolute, 直接显示模式: relative
type: 'absolute',
},
```