vue ==>ts 语法

vue =>ts


//components
import eader from "./header.vue";
@Component({
components: {
eader
}
})
export default class eader extends Vue {

//prop

@Prop() private msg!: string;

//data
activeIndex2: string = "1";
//methods:
public handleSelect(key, keyPath) {
console.log(key, keyPath);
}
handleSelect():void {
console.log(key, keyPath);
} -----------不能有符号
// 声明周期钩子
mounted () {
this.greet()
}

// 计算属性
get computedMsg () {
return 'computed ' + this.msg
}

posted @ 2019-09-10 15:30  Qu西亚  阅读(1196)  评论(0编辑  收藏  举报