2019-10-10 14:30:04 +08:00
|
|
|
## 测试
|
|
|
|
|
|
|
|
|
|
|
|
:::demo
|
|
|
|
```html
|
|
|
|
|
|
|
|
<div id="demo1" class="xm-select-demo"></div>
|
|
|
|
|
|
|
|
<script>
|
2019-10-20 18:01:27 +08:00
|
|
|
//先渲染多选
|
2019-10-10 14:30:04 +08:00
|
|
|
var demo1 = xmSelect.render({
|
|
|
|
el: '#demo1',
|
2019-10-23 14:48:04 +08:00
|
|
|
autoRow: true,
|
|
|
|
filterable: true,
|
|
|
|
create: val => {
|
|
|
|
console.log(val)
|
|
|
|
return {
|
|
|
|
name: val,
|
|
|
|
value: val,
|
|
|
|
}
|
|
|
|
},
|
2019-10-20 18:01:27 +08:00
|
|
|
data(){
|
|
|
|
return [
|
|
|
|
{name: '销售员', children: [
|
|
|
|
{name: '张三1', value: 1, selected: true},
|
|
|
|
{name: '李四1', value: 2, selected: true},
|
|
|
|
{name: '王五1', value: 3, disabled: true},
|
|
|
|
]},
|
|
|
|
{name: '奖品', children: [
|
|
|
|
{name: '苹果2', value: 4, selected: true, disabled: true},
|
|
|
|
{name: '香蕉2', value: 5},
|
|
|
|
{name: '葡萄2', value: 6},
|
|
|
|
]},
|
|
|
|
]
|
|
|
|
}
|
2019-10-10 14:30:04 +08:00
|
|
|
})
|
2019-10-20 18:01:27 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-10 14:30:04 +08:00
|
|
|
</script>
|
|
|
|
```
|
|
|
|
:::
|