2020-06-09 16:17:23 +08:00

37 lines
1001 B
JavaScript

(0, require("../common/component").VantComponent)({
field: !0,
relation: {
name: "radio-group",
type: "ancestor"
},
classes: [ "icon-class", "label-class" ],
props: {
name: null,
value: null,
checkedStyle: {
type: String,
value: "passed"
},
iconSize: {
type: String,
value: "18px"
},
checkedClass: String,
disabled: Boolean,
labelDisabled: Boolean,
labelPosition: String,
checkedColor: String
},
methods: {
emitChange: function(e) {
var a = this.getRelationNodes("../radio-group/index")[0] || this;
a.$emit("input", e), a.$emit("change", e);
},
onChange: function(e) {
this.emitChange(e.detail.value);
},
onClickLabel: function() {
this.data.disabled || this.data.labelDisabled || this.emitChange(this.data.name);
}
}
});