
element-ui 用el-checkbox-group 实现单选效果
element
A Vue.js 2.0 UI Toolkit for Web
项目地址:https://gitcode.com/gh_mirrors/eleme/element
·
1、html
<el-checkbox-group v-model="radio1" @change="handleTime">
<el-checkbox label="1" border >近一周</el-checkbox>
<el-checkbox label="2" border>近一个月</el-checkbox>
<el-checkbox label="3" border >近半年</el-checkbox>
<el-checkbox label="4" border >近一年</el-checkbox>
</el-checkbox-group>
2、JS
// 发布时间
handleTime(value){
if (this.radio1.length > 0) {
this.radio1 = [value[this.radio1.length-1]];
}
const times = this.radio1[0]
if(this.radio1[0] !== undefined) {
this.time(times)
} else {
this.params.start_time = null
this.params.end_time = null
}
},
3 、data里
radio1:[],
A Vue.js 2.0 UI Toolkit for Web
最近提交(Master分支:3 个月前 )
c345bb45
7 个月前
a07f3a59
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update table.md
* Update transition.md
* Update popover.md 7 个月前
更多推荐

所有评论(0)