mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
checkbox component
This commit is contained in:
parent
e0be5b962e
commit
c2a46edeae
@ -12,6 +12,11 @@
|
|||||||
<zan-checkbox-group v-model="result">
|
<zan-checkbox-group v-model="result">
|
||||||
<zan-checkbox v-for="item in list" :name="item">复选框{{item}}</zan-checkbox>
|
<zan-checkbox v-for="item in list" :name="item">复选框{{item}}</zan-checkbox>
|
||||||
</zan-checkbox-group>
|
</zan-checkbox-group>
|
||||||
|
|
||||||
|
<h2 class="page-sub-title">禁用Checkbox组</h2>
|
||||||
|
<zan-checkbox-group v-model="result" disabled>
|
||||||
|
<zan-checkbox v-for="item in list" :name="item">复选框{{item}}</zan-checkbox>
|
||||||
|
</zan-checkbox-group>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -26,7 +31,7 @@ export default {
|
|||||||
'b',
|
'b',
|
||||||
'c'
|
'c'
|
||||||
],
|
],
|
||||||
result: []
|
result: ['a', 'b']
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -17,6 +17,12 @@
|
|||||||
<zan-radio name="2">单选框2</zan-radio>
|
<zan-radio name="2">单选框2</zan-radio>
|
||||||
</zan-radio-group>
|
</zan-radio-group>
|
||||||
|
|
||||||
|
<h2 class="page-sub-title">禁用radio组</h2>
|
||||||
|
<zan-radio-group v-model="radio3" disabled>
|
||||||
|
<zan-radio name="1">单选框1</zan-radio>
|
||||||
|
<zan-radio name="2">单选框2</zan-radio>
|
||||||
|
</zan-radio-group>
|
||||||
|
|
||||||
<h2 class="page-sub-title">与Cell组件一起使用</h2>
|
<h2 class="page-sub-title">与Cell组件一起使用</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -67,6 +67,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* `checkbox`是否被选中
|
||||||
|
*/
|
||||||
isChecked() {
|
isChecked() {
|
||||||
if ({}.toString.call(this.currentValue) === '[object Boolean]') {
|
if ({}.toString.call(this.currentValue) === '[object Boolean]') {
|
||||||
return this.currentValue;
|
return this.currentValue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user