Skip to content

Commit

Permalink
fix(lazyload): lazy-image h is not a function (youzan#11229)
Browse files Browse the repository at this point in the history
in vue 3.x h is not function. this.$slots.default is  a function.

[vue 3.x refs render-function-api-change](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0008-render-function-api-change.md)
[vue 3.x 文档 h 渲染函数](https://cn.vuejs.org/api/render-function.html#h)
  • Loading branch information
ruochuan12 authored and wjw-gavin committed Nov 12, 2022
1 parent 6fde224 commit b8c92ff
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/vant/src/lazyload/vue-lazyload/lazy-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { useRect } from '@vant/use';
import { loadImageAsync } from './util';
import { noop } from '../../utils';
import { h } from 'vue';

export default (lazyManager) => ({
props: {
Expand All @@ -15,15 +16,13 @@ export default (lazyManager) => ({
default: 'img',
},
},
render(h) {
render() {
return h(
this.tag,
{
attrs: {
src: this.renderSrc,
},
src: this.renderSrc,
},
this.$slots.default
this.$slots.default?.()
);
},
data() {
Expand Down

0 comments on commit b8c92ff

Please sign in to comment.