mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 20:04:09 +00:00
[improvement] Picker: shared props (#2888)
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
import { use } from '../utils';
|
||||
import { prevent } from '../utils/event';
|
||||
import { deepClone } from '../utils/deep-clone';
|
||||
import { PickerMixin } from '../mixins/picker';
|
||||
import { pickerProps } from './shared';
|
||||
import Loading from '../loading';
|
||||
import PickerColumn from './PickerColumn';
|
||||
|
||||
const [sfc, bem, t] = use('picker');
|
||||
|
||||
export default sfc({
|
||||
mixins: [PickerMixin],
|
||||
|
||||
props: {
|
||||
...pickerProps,
|
||||
columns: Array,
|
||||
valueKey: {
|
||||
type: String,
|
||||
|
25
packages/picker/shared.ts
Normal file
25
packages/picker/shared.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
export type SharedPickerProps = {
|
||||
title?: string;
|
||||
loading?: boolean;
|
||||
itemHeight: number;
|
||||
showToolbar?: boolean;
|
||||
visibleItemCount: number;
|
||||
cancelButtonText?: string;
|
||||
confirmButtonText?: string;
|
||||
}
|
||||
|
||||
export const pickerProps = {
|
||||
title: String,
|
||||
loading: Boolean,
|
||||
showToolbar: Boolean,
|
||||
cancelButtonText: String,
|
||||
confirmButtonText: String,
|
||||
visibleItemCount: {
|
||||
type: Number,
|
||||
default: 5
|
||||
},
|
||||
itemHeight: {
|
||||
type: Number,
|
||||
default: 44
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user