|
|
@ -76,10 +76,6 @@ Vue.component('union-prop', { |
|
|
|
complexUnion: { type: [User, Number] as PropType<User | number> }, |
|
|
|
kittyUser: Object as PropType<ICat & IUser>, |
|
|
|
callback: Function as PropType<ConfirmCallback>, |
|
|
|
mixed: [RegExp, Array], |
|
|
|
object: [Cat, User], |
|
|
|
primitive: [String, Number], |
|
|
|
regex: RegExp, |
|
|
|
union: [User, Number] as PropType<User | number> |
|
|
|
}, |
|
|
|
data() { |
|
|
@ -87,10 +83,6 @@ Vue.component('union-prop', { |
|
|
|
this.complexUnion; |
|
|
|
this.kittyUser; |
|
|
|
this.callback(true); |
|
|
|
this.mixed; |
|
|
|
this.object; |
|
|
|
this.primitive; |
|
|
|
this.regex.compile; |
|
|
|
this.union; |
|
|
|
return { |
|
|
|
fixedSize: this.union, |
|
|
@ -98,6 +90,22 @@ Vue.component('union-prop', { |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
// stopped working since TS 3.4
|
|
|
|
// Vue.component('union-prop-with-no-casting', {
|
|
|
|
// props: {
|
|
|
|
// mixed: [RegExp, Array],
|
|
|
|
// object: [Cat, User],
|
|
|
|
// primitive: [String, Number],
|
|
|
|
// regex: RegExp
|
|
|
|
// },
|
|
|
|
// data() {
|
|
|
|
// this.mixed;
|
|
|
|
// this.object;
|
|
|
|
// this.primitive;
|
|
|
|
// this.regex.compile;
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
|
|
|
|
Vue.component('prop-with-primitive-default', { |
|
|
|
props: { |
|
|
|
id: { |
|
|
|