refactor(Button): use setup

This commit is contained in:
chenjiahan
2020-08-24 10:52:53 +08:00
parent 2080071a82
commit 4d9b4b3e23
2 changed files with 103 additions and 83 deletions
+5 -9
View File
@@ -14,14 +14,14 @@ const [createComponent, bem, t] = createNamespace('picker');
export default createComponent({
props: {
...pickerProps,
defaultIndex: {
type: [Number, String],
default: 0,
},
columns: {
type: Array,
default: () => [],
},
defaultIndex: {
type: [Number, String],
default: 0,
},
toolbarPosition: {
type: String,
default: 'top',
@@ -135,11 +135,7 @@ export default createComponent({
}
if (this.dataType === 'text') {
this.$emit(
'change',
this.getColumnValue(0),
this.getColumnIndex(0)
);
this.$emit('change', this.getColumnValue(0), this.getColumnIndex(0));
} else {
this.$emit('change', this.getValues(), columnIndex);
}