Skip to content

Instantly share code, notes, and snippets.

@muthu32
Created May 23, 2019 11:25
Show Gist options
  • Save muthu32/fe8c0ae852210648895cb7297d2b7182 to your computer and use it in GitHub Desktop.
Save muthu32/fe8c0ae852210648895cb7297d2b7182 to your computer and use it in GitHub Desktop.
Vue typescript
interface Props {
tmp: string
alpha?: boolean
}
interface Events {
click: string
something: boolean
a: number
b: void
}
interface ScopedSlots {
s1?: {
click?: string
attr: boolean
}
s2?: {
s: null
}
s3: {
a: 'tst'
}
}
class Cmp extends Vue<Props, Events, ScopedSlots> {
created() {
console.log(this.$props.alpha)
this.$emit('a', 2)
this.$emit('b')
}
}
const h = <Cmp tmp="al" on={{ b: () => console.log() }} scopedSlots={{ s3: props => <a /> }} />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment