Merge pull request #1573 from rijn/1191
Support trueValue and falseValue
This commit is contained in:
commit
8db7924cda
4 changed files with 56 additions and 17 deletions
|
@ -1,7 +1,15 @@
|
|||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<Checkbox true-value="true" false-value="false" v-model="testValue1">test string</Checkbox>
|
||||
{{ testValue1 }}
|
||||
</div>
|
||||
<div>
|
||||
<Checkbox :true-value="0" :false-value="1" v-model="testValue2">test number</Checkbox>
|
||||
{{ testValue2 }}
|
||||
</div>
|
||||
<Checkbox-group v-model="fruit">
|
||||
<Checkbox v-for="item in tags" :label="item.label" :key="item"></Checkbox>
|
||||
<Checkbox v-for="item in tags" :label="item.label" :key="item.label" true-value="true"></Checkbox>
|
||||
</Checkbox-group>
|
||||
<div>{{ fruit }}</div>
|
||||
</div>
|
||||
|
@ -12,7 +20,9 @@
|
|||
return {
|
||||
social: ['facebook', 'github'],
|
||||
fruit: ['苹果'],
|
||||
tags: []
|
||||
tags: [],
|
||||
testValue1: null,
|
||||
testValue2: null
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
<template>
|
||||
<div>
|
||||
<Radio true-value="true" false-value="false" v-model="testValue">test</Radio> {{ testValue }}
|
||||
<Radio-group v-model="date.sex">
|
||||
<div v-if="show">
|
||||
<Radio label="male"></Radio>
|
||||
<Radio label="female"></Radio>
|
||||
<Radio label="male" true-value="true" false-value="false"></Radio>
|
||||
<Radio label="female" true-value="true" false-value="false"></Radio>
|
||||
</div>
|
||||
</Radio-group>
|
||||
{{ date }}
|
||||
<Button @click="handleChange">change</Button>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -16,7 +18,8 @@
|
|||
date: {
|
||||
sex: 'male'
|
||||
},
|
||||
show: false
|
||||
show: false,
|
||||
testValue: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue