import Vue = require ( 'vue' ) ; import * as vts from 'vue-typescript-component' ; import { ChildListener } from './child' ; import * as Child from './child.vue' ; @ vts . component ( { components : { Child } } ) export default class ParentTs extends Vue implements ChildListener { @ vts . prop ( { type : String , required : false } ) fromParent : String ; name = 'parent' ; count = 0 ; get opposite ( ) : number { return - this . count ; } inc ( ) { this . count ++ ; } dec ( ) { this . count -- ; } greet ( text ) { if ( text === 'child' ) { this . $emit ( 'signChanged' ) ; this . count = - this . count ; } } }