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

@ -23,6 +23,20 @@ var demo1 = xmSelect.render({
### 方块形状, 隐藏删除图标
```
model: {
label: {
type: 'block',
block: {
//最大显示数量, 0:不限制
showCount: 0,
//是否显示删除图标
showIcon: false,
}
}
},
```
:::demo
```html
<div id="demo2" class="xm-select-demo"></div>
@ -54,6 +68,20 @@ var demo2 = xmSelect.render({
### 方块形状, 超过1个隐藏
```
model: {
label: {
type: 'block',
block: {
//最大显示数量, 0:不限制
showCount: 1,
//是否显示删除图标
showIcon: true,
}
}
},
```
:::demo
```html
<div id="demo3" class="xm-select-demo"></div>
@ -85,6 +113,23 @@ var demo3 = xmSelect.render({
### 简单拼接形式
```
model: {
label: {
type: 'text',
//使用字符串拼接的方式
text: {
//左边拼接的字符
left: '【',
//右边拼接的字符
right: '】',
//中间的分隔符
separator: '',
},
}
},
```
:::demo
```html
<div id="demo4" class="xm-select-demo"></div>
@ -119,6 +164,19 @@ var demo4 = xmSelect.render({
### 自定义显示
```
model: {
label: {
type: 'xxxx', //自定义与下面的对应
xxxx: {
template(data, sels){
return "已选中 " + sels.length + " 项, 共 " + data.length + " 项"
}
},
}
},
```
:::demo
```html
<div id="demo5" class="xm-select-demo"></div>
@ -149,6 +207,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
<div id="demo6" class="xm-select-demo"></div>

View File

@ -133,6 +133,8 @@ model: {
}
},
},
//展示类型, 下拉框形式: absolute, 直接显示模式: relative
type: 'absolute',
},
```