refactor(plugins): update search plugin

This commit is contained in:
qingwei.li 2017-02-19 10:47:47 +08:00 • committed by cinwell.li
commit 079bd00395
22 changed files with 348 additions and 393 deletions

View file

@ -57,15 +57,16 @@ export function fetchMixin (proto) {
.then(text => this._renderCover(text))
}
proto.$fetch = function () {
proto.$fetch = function (cb = noop) {
this._fetchCover()
this._fetch(result => {
this.$resetEvents()
callHook(this, 'doneEach')
cb()
})
}
}
export function initFetch (vm) {
vm.$fetch()
vm.$fetch(_ => callHook(vm, 'ready'))
}