data is actually a function in the vue project, so just do the following:
data() {
let self = this // 加上这一句就OK了
return {
sum: self.count() // count是vue项目里methods中的函数
}
methods: {
count() {
returm 1+2
}
}
data is actually a function in the vue project, so just do the following:
data() {
let self = this // 加上这一句就OK了
return {
sum: self.count() // count是vue项目里methods中的函数
}
methods: {
count() {
returm 1+2
}
}