[improvement] rename packages dir to src (#3659)

This commit is contained in:
neverland
2019-06-27 11:25:57 +08:00
committed by GitHub
parent 8489918dca
commit 75c79b7044
619 changed files with 21 additions and 21 deletions
+42
View File
@@ -0,0 +1,42 @@
import { createNamespace } from '../utils';
import { CheckboxMixin } from '../mixins/checkbox';
const [createComponent, bem] = createNamespace('radio');
export default createComponent({
mixins: [CheckboxMixin({
bem,
role: 'radio',
parent: 'vanRadio'
})],
computed: {
currentValue: {
get() {
return this.parent ? this.parent.value : this.value;
},
set(val) {
(this.parent || this).$emit('input', val);
}
},
checked() {
return this.currentValue === this.name;
}
},
methods: {
onClickIcon() {
if (!this.isDisabled) {
this.currentValue = this.name;
}
},
onClickLabel() {
if (!this.isDisabled && !this.labelDisabled) {
this.currentValue = this.name;
}
}
}
});