style(Picker): improve text size adjust (#6205)
* style(Picker): improve text size adjust * chore: remove text align center * fix: snapsho
This commit is contained in:
@@ -270,7 +270,6 @@ export default createComponent({
|
||||
tabindex: disabled ? -1 : 0,
|
||||
},
|
||||
class: [
|
||||
'van-ellipsis',
|
||||
bem('item', {
|
||||
disabled,
|
||||
selected: index === this.currentIndex,
|
||||
@@ -283,13 +282,18 @@ export default createComponent({
|
||||
},
|
||||
};
|
||||
|
||||
if (this.allowHtml) {
|
||||
data.domProps = {
|
||||
innerHTML: text,
|
||||
};
|
||||
}
|
||||
const childData = {
|
||||
class: 'van-ellipsis',
|
||||
domProps: {
|
||||
[this.allowHtml ? 'innerHTML' : 'innerText']: text,
|
||||
},
|
||||
};
|
||||
|
||||
return <li {...data}>{this.allowHtml ? '' : text}</li>;
|
||||
return (
|
||||
<li {...data}>
|
||||
<div {...childData} />
|
||||
</li>
|
||||
);
|
||||
});
|
||||
},
|
||||
},
|
||||
@@ -299,7 +303,6 @@ export default createComponent({
|
||||
transform: `translate3d(0, ${this.offset + this.baseOffset}px, 0)`,
|
||||
transitionDuration: `${this.duration}ms`,
|
||||
transitionProperty: this.duration ? 'all' : 'none',
|
||||
lineHeight: `${this.itemHeight}px`,
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user