xm-select/docs/mds/ZTEST.md

58 lines
1.2 KiB
Markdown
Raw Normal View History

## 测试
2019-11-22 12:33:17 +00:00
:::demo
```html
<div id="demo1" class="xm-select-demo"></div>
<script>
var demo1 = xmSelect.render({
2019-11-19 12:13:50 +00:00
el: '#demo1',
autoRow: true,
2019-11-26 07:50:59 +00:00
paging: true,
pageSize: 2,
2019-11-19 12:13:50 +00:00
tree: {
2019-11-26 04:20:02 +00:00
strict: true,
show: false,
2019-11-22 12:33:17 +00:00
showFolderIcon: true,
showLine: true,
indent: 20,
expandedKeys: [ -1 ],
lazy: true,
load: function(item, cb){
setTimeout(function(){
var name = item.name + 1;
cb([
{name: item.name + 1, value: item.value + '1', children: [] },
{name: item.name + 2, value: item.value + '2' },
])
}, 500)
2019-11-26 04:20:02 +00:00
},
},
toolbar: {
show: true
2019-11-19 12:13:50 +00:00
},
height: 'auto',
data(){
return [
2019-11-26 04:20:02 +00:00
{name: '销售员', value: -1, selected: true, children: [
{name: '张三1', value: 100, selected: false, children: []},
{name: '李四1', value: 2, selected: false},
{name: '王五1', value: 3, disabled: false},
2019-11-19 12:13:50 +00:00
]},
{name: '奖品', value: -2, children: [
{name: '奖品3', value: -3, children: [
2019-11-26 04:20:02 +00:00
{name: '苹果3', value: 14, selected: false},
2019-11-19 12:13:50 +00:00
{name: '香蕉3', value: 15},
{name: '葡萄3', value: 16},
]},
2019-11-26 04:20:02 +00:00
{name: '苹果2', value: 4, selected: false, disabled: true},
2019-11-19 12:13:50 +00:00
{name: '香蕉2', value: 5},
{name: '葡萄2', value: 6},
]},
]
}
})
2019-11-22 12:33:17 +00:00
</script>
```
:::