feat: migrate Picker component

This commit is contained in:
chenjiahan
2020-07-26 15:41:09 +08:00
parent 7e47a0721b
commit 9fa7a258d7
5 changed files with 50 additions and 45 deletions
+7 -11
View File
@@ -43,6 +43,8 @@ export default createComponent({
},
},
emits: ['change'],
data() {
return {
offset: 0,
@@ -266,28 +268,22 @@ export default createComponent({
const data = {
style: optionStyle,
attrs: {
role: 'button',
tabindex: disabled ? -1 : 0,
},
role: 'button',
tabindex: disabled ? -1 : 0,
class: [
bem('item', {
disabled,
selected: index === this.currentIndex,
}),
],
on: {
click: () => {
this.onClickItem(index);
},
onClick: () => {
this.onClickItem(index);
},
};
const childData = {
class: 'van-ellipsis',
domProps: {
[this.allowHtml ? 'innerHTML' : 'textContent']: text,
},
[this.allowHtml ? 'innerHTML' : 'textContent']: text,
};
return (