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
}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM