修复开启动态搜索, 搜索无反应

This commit is contained in:
maplemei 2019-12-18 14:38:35 +08:00
parent c64b497482
commit 036126d58c
5 changed files with 16 additions and 61 deletions

2
dist/static/2.js vendored

File diff suppressed because one or more lines are too long

2
dist/xm-select.js vendored

File diff suppressed because one or more lines are too long

View File

@ -7,62 +7,17 @@
<script>
var demo1 = xmSelect.render({
el: '#demo1',
paging: true,
pageSize: 2,
autoRow: true,
tree: {
strict: false,
show: true,
showFolderIcon: true,
showLine: true,
indent: 20,
expandedKeys: [ 14 ],
lazy: true,
load: function(item, cb){
setTimeout(function(){
if(item.name.endsWith('2')){
return cb([]);
}
cb([
{name: item.name + 1, value: item.value + '1', children: [] },
{name: item.name + 2, value: item.value + '2', children: [] },
])
}, 500)
}
},
model: {
icon: 'show'
},
radio: true,
toolbar: {
show: true
},
height: 'auto',
on: function(a){
console.log(this)
}.bind('#demo1'),
data(){
return [
{name: '北京市时代峰峻莱克斯顿荆防颗粒受到了开发建设的路口附近', value: -1, children: [
{name: '朝阳区', value: 1, children: [
{name: '河北省', value: -12, children: [
{name: '廊坊市', value: 14, selected: true},
{name: '石家庄', value: 15, selected: true},
{name: '邯郸市', value: 16},
]}
]},
{name: '海淀区', value: 2},
{name: '通州区', value: 3},
]},
{name: '河北省', value: -2, children: [
{name: '廊坊市', value: 4},
{name: '石家庄', value: 5},
{name: '邯郸市', value: 6},
]},
]
},
data: [
],
})
setTimeout(function(){
demo1.update({
empty: 'xxx'
})
}, 1000)
</script>
```
:::

View File

@ -258,7 +258,7 @@ class General extends Component{
}
const search = (
<div class='xm-search'>
<div class={ filterable ? 'xm-search' : 'xm-search dis' }>
<i class="xm-iconfont xm-icon-sousuo"></i>
<input class="xm-input xm-search-input" placeholder={ searchTips } />
</div>
@ -466,7 +466,7 @@ class General extends Component{
<div onClick={ this.blockClick } tabindex="1" style="outline: none;">
<div>
{ config.toolbar.show && toolbar }
{ filterable && search }
{ search }
<div class="scroll-body" style={ {maxHeight: config.height} }>{ arr }</div>
{ config.paging && paging }
</div>

View File

@ -318,7 +318,7 @@ class Tree extends Component{
)
const search = (
<div class='xm-search'>
<div class={ filterable ? 'xm-search' : 'xm-search dis' }>
<i class="xm-iconfont xm-icon-sousuo"></i>
<input class="xm-input xm-search-input" placeholder={ searchTips } />
</div>
@ -332,7 +332,7 @@ class Tree extends Component{
// { config.toolbar.show && toolbar }
return (
<div onClick={ this.blockClick } class="xm-body-tree" >
{ filterable && search }
{ search }
<div class="scroll-body" style={ {maxHeight: config.height} }>{ arr }</div>
</div>
)