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