在fetch中不能写异步请求?
laodifanga opened this issue · comments
老地方 commented
import {addressList} from '@/api'
import { mapModules, mapRules } from 'vuet'
const mixins = [
mapModules({
$address: 'address'
}),
mapRules({
once: [{ path: 'address' }]
})
]
export default {
mixins,
module: {
data () {
return {
data: ''
}
},
fetch (uid) {
setTimeout(() => {
this.data = 'fetch'
}, 1000)
},
async getData(uid = 1) {
setTimeout(() => {
this.data = 111
}, 1000)
return
let res = await addressList({uid})
this.data = res.data
}
}
}
这么写 data 返回的 居然是 function proxy() { return native.apply(vuet.modules[path], arguments); }
lzxb commented
addressList 是什么?