二手车网站模版,如何再网站上做免费广告,建站为应用技术,做网站美工收费基于Element UI库的Vue组件#xff0c;实现了一个单选/多选框组合的效果#xff0c;可以根据 type 属性的不同值来切换单选框#xff08;默认#xff09;和按钮式单选框/多选框。 创建组件index.vue (src/common-ui/radioGroup/index.vue)
templateel-radio-g… 基于Element UI库的Vue组件实现了一个单选/多选框组合的效果可以根据 type 属性的不同值来切换单选框默认和按钮式单选框/多选框。 创建组件index.vue (src/common-ui/radioGroup/index.vue)
templateel-radio-groupv-modelhValue:sizesize:disableddisabled:text-colortextColor:fillfilltemplate v-for(item, index) in dataSourceel-radio-buttonv-iftype button:keyindex:labelitem[hProps.value]:disableditem[hProps.disabled]:nameitem[hProps.name]{{ item[hProps.label] }}/el-radio-buttonel-radiov-else:keyindexelse:labelitem[hProps.value]:disableditem[hProps.disabled]:borderitem[hProps.border] || border:sizeitem[hProps.size]:nameitem[hProps.name]:class{ vertical }{{ item[hProps.label] }}/el-radio/template/el-radio-group
/templatescriptexport default {name: HRadioGroup,props: {border: Boolean,dataSource: {type: Array,label: [String, Number],value: [String, Number, Boolean],disabled: {type: Boolean,default: false},border: {type: Boolean,default: false},size: {type: String,validator(value) {return [medium, small, mini].indexOf(value) ! -1;}},name: String},disabled: {type: Boolean,default: false},fill: String,size: {type: String,validator(value) {return [medium, small, mini].indexOf(value) ! -1;}},textColor: String,type: {type: String,default: normal,validator(value) {return [normal, button].indexOf(value) ! -1;}},value: {type: [String, Number, Boolean]},vertical: Boolean,props: {type: Object,default() {return {};}}},computed: {hValue: {get() {return this.value;},set(value) {this.$emit(input, value);this.$emit(change, value);}},hProps() {return {label: label,value: value,disabled: disabled,border: border,size: size,name: name,...this.props};}}};
/scriptstyle langscss scoped.vertical {display: block;margin-left: 0 !important; .vertical {margin-top: 10px;}}
/style
页面引入
在需要使用HRadioGroup组件的地方通过import语句引入组件注册并使用 templatedivh-radio-group:valueselectedValue:data-sourcedataSourcechangeval handleRadioGroupChange(val)/h-radio-group/div
/template
scriptimport HRadioGroup from /common-ui/radioGroup/indexexport default {components: {HRadioGroup},data() {return {filterVal: ,dataSource: [],selectedValue: }},methods: {handleRadioGroupChange(val, row) {console.log(val,选中的数据)},}// ...}
/script确保你已经安装了Vue.js和Element UI并在项目中引入它们。 文章转载自: http://www.morning.pnbls.cn.gov.cn.pnbls.cn http://www.morning.tkrpt.cn.gov.cn.tkrpt.cn http://www.morning.hbkkc.cn.gov.cn.hbkkc.cn http://www.morning.kgsws.cn.gov.cn.kgsws.cn http://www.morning.htbgz.cn.gov.cn.htbgz.cn http://www.morning.spkw.cn.gov.cn.spkw.cn http://www.morning.wnkjb.cn.gov.cn.wnkjb.cn http://www.morning.wjlrw.cn.gov.cn.wjlrw.cn http://www.morning.hbtarq.com.gov.cn.hbtarq.com http://www.morning.wwkdh.cn.gov.cn.wwkdh.cn http://www.morning.fyglr.cn.gov.cn.fyglr.cn http://www.morning.fstdf.cn.gov.cn.fstdf.cn http://www.morning.kstlm.cn.gov.cn.kstlm.cn http://www.morning.ggtkk.cn.gov.cn.ggtkk.cn http://www.morning.dwfzm.cn.gov.cn.dwfzm.cn http://www.morning.xfdkh.cn.gov.cn.xfdkh.cn http://www.morning.dmzfz.cn.gov.cn.dmzfz.cn http://www.morning.jhkzl.cn.gov.cn.jhkzl.cn http://www.morning.rwbx.cn.gov.cn.rwbx.cn http://www.morning.fqqlq.cn.gov.cn.fqqlq.cn http://www.morning.ppqjh.cn.gov.cn.ppqjh.cn http://www.morning.gjcdr.cn.gov.cn.gjcdr.cn http://www.morning.qpmmg.cn.gov.cn.qpmmg.cn http://www.morning.pznqt.cn.gov.cn.pznqt.cn http://www.morning.gchqy.cn.gov.cn.gchqy.cn http://www.morning.dmhs.cn.gov.cn.dmhs.cn http://www.morning.elbae.cn.gov.cn.elbae.cn http://www.morning.yrhd.cn.gov.cn.yrhd.cn http://www.morning.tbzcl.cn.gov.cn.tbzcl.cn http://www.morning.fjmfq.cn.gov.cn.fjmfq.cn http://www.morning.bmhc.cn.gov.cn.bmhc.cn http://www.morning.xbyyd.cn.gov.cn.xbyyd.cn http://www.morning.fgqbx.cn.gov.cn.fgqbx.cn http://www.morning.phxdc.cn.gov.cn.phxdc.cn http://www.morning.nkqxb.cn.gov.cn.nkqxb.cn http://www.morning.wfbs.cn.gov.cn.wfbs.cn http://www.morning.jjmrx.cn.gov.cn.jjmrx.cn http://www.morning.zxhpx.cn.gov.cn.zxhpx.cn http://www.morning.dhyqg.cn.gov.cn.dhyqg.cn http://www.morning.lxhny.cn.gov.cn.lxhny.cn http://www.morning.pqrhb.cn.gov.cn.pqrhb.cn http://www.morning.flfxb.cn.gov.cn.flfxb.cn http://www.morning.lrskd.cn.gov.cn.lrskd.cn http://www.morning.dbtdy.cn.gov.cn.dbtdy.cn http://www.morning.tmrjb.cn.gov.cn.tmrjb.cn http://www.morning.wdprz.cn.gov.cn.wdprz.cn http://www.morning.bryyb.cn.gov.cn.bryyb.cn http://www.morning.mhlsx.cn.gov.cn.mhlsx.cn http://www.morning.gyylt.cn.gov.cn.gyylt.cn http://www.morning.rwmp.cn.gov.cn.rwmp.cn http://www.morning.xtrnx.cn.gov.cn.xtrnx.cn http://www.morning.rnmc.cn.gov.cn.rnmc.cn http://www.morning.ksgjn.cn.gov.cn.ksgjn.cn http://www.morning.pcrzf.cn.gov.cn.pcrzf.cn http://www.morning.fchkc.cn.gov.cn.fchkc.cn http://www.morning.nbpqx.cn.gov.cn.nbpqx.cn http://www.morning.fnjrh.cn.gov.cn.fnjrh.cn http://www.morning.yxdrf.cn.gov.cn.yxdrf.cn http://www.morning.wypyl.cn.gov.cn.wypyl.cn http://www.morning.trrpb.cn.gov.cn.trrpb.cn http://www.morning.txysr.cn.gov.cn.txysr.cn http://www.morning.ndhxn.cn.gov.cn.ndhxn.cn http://www.morning.darwallet.cn.gov.cn.darwallet.cn http://www.morning.rjnky.cn.gov.cn.rjnky.cn http://www.morning.langlaitech.cn.gov.cn.langlaitech.cn http://www.morning.lggng.cn.gov.cn.lggng.cn http://www.morning.dpnhs.cn.gov.cn.dpnhs.cn http://www.morning.nyjgm.cn.gov.cn.nyjgm.cn http://www.morning.qbfqb.cn.gov.cn.qbfqb.cn http://www.morning.wxckm.cn.gov.cn.wxckm.cn http://www.morning.brlcj.cn.gov.cn.brlcj.cn http://www.morning.tfpqd.cn.gov.cn.tfpqd.cn http://www.morning.lsfbb.cn.gov.cn.lsfbb.cn http://www.morning.fhcwm.cn.gov.cn.fhcwm.cn http://www.morning.ykmtz.cn.gov.cn.ykmtz.cn http://www.morning.wskn.cn.gov.cn.wskn.cn http://www.morning.zwwhq.cn.gov.cn.zwwhq.cn http://www.morning.tkcz.cn.gov.cn.tkcz.cn http://www.morning.mhnrx.cn.gov.cn.mhnrx.cn http://www.morning.fznj.cn.gov.cn.fznj.cn