优化界面

This commit is contained in:
GoEdgeLab
2020-11-18 15:41:29 +08:00
parent bceb432143
commit 545ec75842
6 changed files with 70 additions and 22 deletions

View File

@@ -0,0 +1,23 @@
let radioId = 0
Vue.component("radio", {
props: ["name", "value", "v-value", "id"],
data: function () {
radioId++
let elementId = this.id
if (elementId == null) {
elementId = "radio" + radioId
}
return {
"elementId": elementId
}
},
methods: {
change: function () {
this.$emit("input", this.vValue)
}
},
template: `<div class="ui checkbox radio">
<input type="radio" :name="name" :value="vValue" :id="elementId" @change="change" :checked="(vValue == value)"/>
<label :for="elementId"><slot></slot></label>
</div>`
})