<text style="padding-right: 10px; color: #333; font-size: 28px" slot="value">{{birthdayDate}}</text>
這裏名稱,不須要定義(實際是函數名)函數
重構:this
computed: { birthdayDate() { return this.getDate(this.user.birthday) } }
注意:birthdayDate 是轉換過的名稱,this.getDate(this.date) 轉換函數內的名稱是原有的名稱spa
-------------------------------------code
轉時間戳blog
getTimestamp (mytime){
let dateTmp = mytime.replace(/-/g,'/')
return Date.parse(dateTmp)
},
get