style(Picker): add @picker-option-height less var (#6571)

This commit is contained in:
neverland
2020-06-19 06:36:23 +08:00
committed by GitHub
parent 717352b453
commit 99db42372c
13 changed files with 727 additions and 723 deletions
+6 -3
View File
@@ -3,6 +3,7 @@ import { createNamespace, isObject } from '../utils';
import { range } from '../utils/format/number';
import { preventDefault } from '../utils/dom/event';
import { TouchMixin } from '../mixins/touch';
import { DEFAULT_ITEM_HEIGHT } from './shared';
const DEFAULT_DURATION = 200;
@@ -255,9 +256,11 @@ export default createComponent({
},
genOptions() {
const optionStyle = {
height: `${this.itemHeight}px`,
};
const optionStyle = {};
if (this.itemHeight !== DEFAULT_ITEM_HEIGHT) {
optionStyle.height = `${this.itemHeight}px`;
}
return this.options.map((option, index) => {
const text = this.getOptionText(option);