mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(lazyload): lazy-image h is not a function (#11229)
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)
This commit is contained in:
parent
842c92d3c9
commit
f071e48be2
@ -6,6 +6,7 @@
|
|||||||
import { useRect } from '@vant/use';
|
import { useRect } from '@vant/use';
|
||||||
import { loadImageAsync } from './util';
|
import { loadImageAsync } from './util';
|
||||||
import { noop } from '../../utils';
|
import { noop } from '../../utils';
|
||||||
|
import { h } from 'vue';
|
||||||
|
|
||||||
export default (lazyManager) => ({
|
export default (lazyManager) => ({
|
||||||
props: {
|
props: {
|
||||||
@ -15,15 +16,13 @@ export default (lazyManager) => ({
|
|||||||
default: 'img',
|
default: 'img',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
render(h) {
|
render() {
|
||||||
return h(
|
return h(
|
||||||
this.tag,
|
this.tag,
|
||||||
{
|
{
|
||||||
attrs: {
|
src: this.renderSrc,
|
||||||
src: this.renderSrc,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
this.$slots.default
|
this.$slots.default?.()
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user