CNCEC_APP/uni_modules/uview-pro/components/common/props.ts

23 lines
522 B
TypeScript
Raw Normal View History

2026-03-25 14:54:15 +08:00
import type { PropType } from 'vue';
export const stringProp = <T>(defaultVal: T) => ({
type: String as unknown as PropType<T>,
default: defaultVal
});
export const stringOrObjectProp = <T>(defaultVal: T) => ({
type: [String, Object] as PropType<string | Record<string, any>>,
default: defaultVal
});
export const baseProps = {
/**
*
*/
customStyle: stringOrObjectProp(''),
/**
*
*/
customClass: stringProp('')
};