Skip to content

Instantly share code, notes, and snippets.

@fadamakis
Created August 9, 2022 14:09
<script lang="ts">
import Vue, { PropType } from 'vue'
interface Book {
title: string
author: string
year: number
}
const Component = Vue.extend({
props: {
book: {
type: Object as PropType<Book>,
required: true,
validator (book: Book) {
return !!book.title;
}
}
}
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment