Skip to content

Instantly share code, notes, and snippets.

@shershen08
Last active October 26, 2019 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shershen08/b13ea76b0409ab3d121453b6014fd0f3 to your computer and use it in GitHub Desktop.
Save shershen08/b13ea76b0409ab3d121453b6014fd0f3 to your computer and use it in GitHub Desktop.
vue typescript child components
import { Component, Prop, Vue, Watch, Emit } from 'vue-property-decorator';
@Component
export class SearchForm extends Vue {
public search: string = 'vue';
@Prop() private color!: string;
@Watch('search')
@Emit('search:text')
private onSeachChanged(val: string, oldVal: string) {
return val;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment