Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
fix(ui/lazy): fix lazy updated error
Browse files Browse the repository at this point in the history
  • Loading branch information
haoziqaq committed Feb 18, 2022
1 parent 8c2bb09 commit 609c3f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ exports[`test lazy updated 1`] = `"<img lazy-error=\\"https://varlet.gitee.io/va
exports[`test lazy updated 2`] = `"<img lazy-error=\\"https://varlet.gitee.io/varlet-ui/error.jpg\\" src=\\"https://varlet.gitee.io/varlet-ui/cat.jpg\\">"`;
exports[`test lazy updated 3`] = `"<img lazy-error=\\"https://varlet.gitee.io/varlet-ui/error.jpg\\" src=\\"https://varlet.gitee.io/varlet-ui/cat.jpg\\">"`;
exports[`test lazy updated 3`] = `"<img lazy-error=\\"https://varlet.gitee.io/varlet-ui/error.jpg\\" src=\\"https://varlet.gitee.io/varlet-ui/dog.jpg\\">"`;
4 changes: 2 additions & 2 deletions packages/varlet-vue2-ui/src/lazy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ async function mounted(el: LazyHTMLElement, binding: DirectiveBinding) {
await add(el)
}

async function updated(el: LazyHTMLElement, binding: DirectiveBinding) {
async function update(el: LazyHTMLElement, binding: DirectiveBinding) {
if (!diff(el, binding)) {
lazyElements.includes(el) && (await check(el))
return
Expand All @@ -211,7 +211,7 @@ function mergeLazyOptions(lazyOptions: LazyOptions = {}) {
const Lazy: DirectiveOptions & PluginObject<LazyOptions> = {
inserted: mounted,
unbind: clear,
updated,
update,
install(app: VueConstructor, lazyOptions?: LazyOptions) {
mergeLazyOptions(lazyOptions)

Expand Down

0 comments on commit 609c3f8

Please sign in to comment.