File tree 2 files changed +7
-3
lines changed
server/src/services/typescriptService
test/interpolation/fixture/diagnostics/propTypeValidation
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -299,10 +299,13 @@ function convertChildComponentsInfoToSource(childComponents: ChildComponent[]) {
299
299
300
300
const propTypeStrings : string [ ] = [ ] ;
301
301
c . info ?. componentInfo . props ?. forEach ( p => {
302
- let typeKey = p . required ? kebabCase ( p . name ) : kebabCase ( p . name ) + '?' ;
303
- if ( typeKey . indexOf ( '-' ) !== - 1 ) {
302
+ let typeKey = kebabCase ( p . name ) ;
303
+ if ( typeKey . includes ( '-' ) ) {
304
304
typeKey = `'` + typeKey + `'` ;
305
305
}
306
+ if ( ! p . required ) {
307
+ typeKey += '?' ;
308
+ }
306
309
307
310
if ( p . typeString ) {
308
311
propTypeStrings . push ( `${ typeKey } : ${ p . typeString } ` ) ;
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ export default Vue.extend({
8
8
callback: {
9
9
type: Function as PropType <() => void >
10
10
},
11
- arr: Array as PropType <string []>
11
+ arr: Array as PropType <string []>,
12
+ darkMode: { type: Boolean , default: false }
12
13
}
13
14
});
14
15
</script >
You can’t perform that action at this time.
0 commit comments