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
}