xm-select/docs/mds/ZTEST.md

62 lines
1.6 KiB
Markdown
Raw Normal View History

## 测试
2019-11-22 20:33:17 +08:00
:::demo
```html
<div id="demo1" class="xm-select-demo"></div>
<script>
2021-01-19 16:28:25 +08:00
xmSelect.render({
2019-11-19 20:13:50 +08:00
el: '#demo1',
2021-05-28 18:30:08 +08:00
autoRow: true,
2021-07-22 13:16:36 +08:00
tree: {
2021-05-28 18:30:08 +08:00
show: true,
2020-11-26 14:44:46 +08:00
},
2021-05-28 18:30:08 +08:00
height: '200px',
maxMethod(a, item){
console.log(item)
},
submitConversion(sels, prop){
return sels.map(item => item[prop.name]).join(',')
},
2021-07-22 13:16:36 +08:00
filterable: true,
2021-05-28 18:30:08 +08:00
data(){
return [
{name: '销售员', value: -1, disabled: false, children: [
{name: '张三1', value: 1, selected: true, children: []},
{name: '王五1', value: 13, disabled: true},
{name: '王五1', value: 131, disabled: true},
{name: '王五1', value: 132, disabled: true},
{name: '王五1', value: 133, disabled: true},
{name: '王五1', value: 134, disabled: true},
{name: '王五1', value: 135, disabled: true},
{name: '王五1', value: 136, disabled: true},
{name: '王五1', value: 137, disabled: true},
{name: '王五1', value: 138, disabled: true},
]},
{name: '奖品', value: -2, children: [
{name: '奖品3', value: -3, children: [
]},
{name: '苹果2', value: 4, disabled: true},
{name: '香蕉2', value: 5},
{name: '葡萄2', value: 6},
]},
{name: '李四1', value: 2},
{name: '王五1', value: 3, disabled: true},
{name: '王五1', value: 31, disabled: true},
{name: '王五1', value: 32, disabled: true},
{name: '王五1', value: 33, disabled: true},
{name: '王五1', value: 34, disabled: true},
{name: '王五1', value: 35, disabled: true},
{name: '王五1', value: 36, disabled: true},
{name: '王五1', value: 37, disabled: true},
{name: '王五1', value: 38, disabled: true},
]
}
2021-01-19 16:28:25 +08:00
})
2019-11-22 20:33:17 +08:00
</script>
```
:::