B
B
bormor2019-09-26 16:14:16
typescript
bormor, 2019-09-26 16:14:16

Vue and TypeScript - how to set both default value and type check in @Props?

Type checking in runtime (type = string):
@Prop(String) title!: string
Default
value @Prop({ default: 'fit text-h5' }) title!: string
And how to set the default value at the same time?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2019-09-26
@bormor

@Prop({ type: String, default: 'fit text-h5' }) title!: string

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question