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
}

猜你喜欢

转载自www.cnblogs.com/Quxiya/p/11497718.html