fixed #1797
This commit is contained in:
parent
6f719603a8
commit
1f41c9ca2c
3 changed files with 40 additions and 53 deletions
|
@ -1,59 +1,46 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<h4>有remote属性</h4>
|
<Select v-model="model1" style="width:200px">
|
||||||
{{ selectedIds }}
|
<Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
||||||
<i-select remote clearable filterable multiple :label="selectedLabel" v-model="selectedIds" style='margin-bottom:20px;'>
|
</Select>
|
||||||
<i-option v-for="option in list" :value="option.id" :key="option.id">{{option.name}}</i-option>
|
<Select v-model="model2" style="width:200px">
|
||||||
</i-select>
|
<Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
||||||
<i-button @click="setVal3">设置3</i-button>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
list: [],
|
cityList: [
|
||||||
selectedIds: [],
|
{
|
||||||
selectedLabel: []
|
value: 'beijing',
|
||||||
|
label: '北京市'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'shanghai',
|
||||||
|
label: '上海市'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'shenzhen',
|
||||||
|
label: '深圳市'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'hangzhou',
|
||||||
|
label: '杭州市'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'nanjing',
|
||||||
|
label: '南京市'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'chongqing',
|
||||||
|
label: '重庆市'
|
||||||
}
|
}
|
||||||
},
|
],
|
||||||
methods: {
|
model1: 'beijing',
|
||||||
setVal1: function () {
|
model2: 'shanghai'
|
||||||
this.selectedLabel = ['几何', '化学'];
|
|
||||||
this.selectedIds = ['201701041343', '201701011541']
|
|
||||||
|
|
||||||
},
|
|
||||||
setVal2: function () {
|
|
||||||
this.selectedLabel = ['政治', '英语', '数学'];
|
|
||||||
this.selectedIds = ['201701031442', '201701061244', '201701011145']
|
|
||||||
},
|
|
||||||
setVal3: function () {
|
|
||||||
this.selectedLabel = [];
|
|
||||||
this.selectedIds = [];
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
mounted () {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.list = [{
|
|
||||||
name: '语文',
|
|
||||||
id: '201701011046'
|
|
||||||
}, {
|
|
||||||
name: '数学',
|
|
||||||
id: '201701011145'
|
|
||||||
}, {
|
|
||||||
name: '英语',
|
|
||||||
id: '201701061244'
|
|
||||||
}, {
|
|
||||||
name: '几何',
|
|
||||||
id: '201701041343'
|
|
||||||
}, {
|
|
||||||
name: '政治',
|
|
||||||
id: '201701031442'
|
|
||||||
}, {
|
|
||||||
name: '化学',
|
|
||||||
id: '201701011541'
|
|
||||||
}]
|
|
||||||
}, 1000)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<i-switch v-model="m1" :true-value="1" :false-value="0">
|
<i-switch v-model="m1" true-value="yes" false-value="no">
|
||||||
<span slot="open">开</span>
|
<span slot="open">开</span>
|
||||||
<span slot="close">关</span>
|
<span slot="close">关</span>
|
||||||
</i-switch>
|
</i-switch>
|
||||||
{{ m1 }}
|
{{ m1 }}
|
||||||
<div @click="m1 = 0">toggle</div>
|
<div @click="m1 = 'no'">toggle</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
m1: 1
|
m1: 'yes'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<span :class="wrapClasses" @click="toggle">
|
<span :class="wrapClasses" @click="toggle">
|
||||||
<span :class="innerClasses">
|
<span :class="innerClasses">
|
||||||
<slot name="open" v-if="currentValue"></slot>
|
<slot name="open" v-if="currentValue === trueValue"></slot>
|
||||||
<slot name="close" v-if="!currentValue"></slot>
|
<slot name="close" v-if="currentValue === falseValue"></slot>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
return [
|
return [
|
||||||
`${prefixCls}`,
|
`${prefixCls}`,
|
||||||
{
|
{
|
||||||
[`${prefixCls}-checked`]: this.currentValue,
|
[`${prefixCls}-checked`]: this.currentValue === this.trueValue,
|
||||||
[`${prefixCls}-disabled`]: this.disabled,
|
[`${prefixCls}-disabled`]: this.disabled,
|
||||||
[`${prefixCls}-${this.size}`]: !!this.size
|
[`${prefixCls}-${this.size}`]: !!this.size
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue