types(IndexBar): index-list prop can includes number (#10273)

This commit is contained in:
neverland 2022-02-09 14:22:33 +08:00 committed by GitHub
parent daa8e4b9bb
commit 9b7af21bbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -58,7 +58,7 @@ const indexBarProps = {
highlightColor: String, highlightColor: String,
stickyOffsetTop: makeNumberProp(0), stickyOffsetTop: makeNumberProp(0),
indexList: { indexList: {
type: Array as PropType<string[]>, type: Array as PropType<Array<string | number>>,
default: genAlphabet, default: genAlphabet,
}, },
}; };
@ -76,7 +76,7 @@ export default defineComponent({
setup(props, { emit, slots }) { setup(props, { emit, slots }) {
const root = ref<HTMLElement>(); const root = ref<HTMLElement>();
const activeAnchor = ref(''); const activeAnchor = ref<string | number>('');
const touch = useTouch(); const touch = useTouch();
const scrollParent = useScrollParent(root); const scrollParent = useScrollParent(root);

View File

@ -4,6 +4,7 @@ import {
onUnmounted, onUnmounted,
defineComponent, defineComponent,
type PropType, type PropType,
type TeleportProps,
type CSSProperties, type CSSProperties,
type ExtractPropTypes, type ExtractPropTypes,
} from 'vue'; } from 'vue';
@ -49,6 +50,7 @@ const toastProps = {
iconSize: numericProp, iconSize: numericProp,
duration: makeNumberProp(2000), duration: makeNumberProp(2000),
position: makeStringProp<ToastPosition>('middle'), position: makeStringProp<ToastPosition>('middle'),
teleport: [String, Object] as PropType<TeleportProps['to']>,
className: unknownProp, className: unknownProp,
iconPrefix: String, iconPrefix: String,
transition: makeStringProp('van-fade'), transition: makeStringProp('van-fade'),