This commit is contained in:
maplemei 2019-09-25 17:55:14 +08:00
parent 2d26f68640
commit c31995f59b
4 changed files with 9 additions and 9 deletions

2
dist/static/2.js vendored

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,7 @@
<script>
var demo1 = xmSelect.render({
el: '#demo1',
filterable: true,
filterable: true,
data: [
{name: '水果', value: 1},
{name: '蔬菜', value: 2},

View File

@ -12,7 +12,7 @@
<script>
var demo1 = xmSelect.render({
el: '#demo1',
direction: 'auto',
direction: 'auto',
data: [
{name: '水果', value: 1},
{name: '蔬菜', value: 2},

View File

@ -12,9 +12,9 @@
<script>
var demo1 = xmSelect.render({
el: '#demo1',
on({ arr, item, selected }){
alert(`name: ${item.name}, 状态: ${selected}`)
},
on({ arr, item, selected }){
alert(`name: ${item.name}, 状态: ${selected}`)
},
data: [
{name: '张三', value: 'zhangsan', selected: true},
{name: '李四', value: 'lisi', selected: true},
@ -37,14 +37,14 @@ var demo1 = xmSelect.render({
<script>
var demo2 = xmSelect.render({
el: '#demo2',
on({ arr, item, selected }){
if(selected){
on({ arr, item, selected }){
if(selected){
var index = arr.findIndex(i => i.mutex == item.mutex && i.value != item.value);
if(index != -1){
arr.splice(index, 1);
}
}
},
},
data: [
{name: '北京', value: 1, mutex: 1, selected: true},
{name: '上海', value: 2, mutex: 1},