From 831e4cd157176df28ab684d61ca6b94a10876c50 Mon Sep 17 00:00:00 2001 From: ktsn Date: Mon, 16 Apr 2018 20:07:07 +0900 Subject: [PATCH] docs: separate props definition to make their types be inferable --- example/App.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/example/App.vue b/example/App.vue index 7d093a7..dcda04f 100644 --- a/example/App.vue +++ b/example/App.vue @@ -17,19 +17,21 @@ import Component from '../lib/index' import Hello from './Hello.vue' import World from './World' -@Component({ +// We declare the props separately +// to make props types inferable. +const AppProps = Vue.extend({ props: { propMessage: String - }, + } +}) + +@Component({ components: { Hello, World } }) -export default class App extends Vue { - // props have to be declared for typescript - propMessage!: string - +export default class App extends AppProps { // inital data msg: number = 123 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy