Compare commits

...

3 Commits

Author SHA1 Message Date
neverland
44281be985
docs(changelog): vant@3.6.5 (#11232) 2022-11-08 10:46:58 +08:00
chenjiahan
78d6bcc939 release: 3.6.5 2022-11-08 10:43:14 +08:00
若川
711f9cc852
fix(lazyload): lazy-image h is not a function (#11230)
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 docs h](https://cn.vuejs.org/api/render-function.html#h)

- reappear
- test

```vue
// vant/packages/vant/src/lazyload/demo/index.vue
<script lang="ts">
import Lazyload from '..';

if (window.app) {
  window.app.use(Lazyload, { lazyComponent: true, lazyImage: true });
}
</script>
<template>
   <demo-block :title="t('basicUsage')">
    <lazy-image v-for="img in imageList" :key="img" :src="img">
    </lazy-image>
  </demo-block>
</teamplate>
```
2022-11-08 10:14:49 +08:00
4 changed files with 29 additions and 6 deletions

View File

@ -19,6 +19,18 @@ Vant follows [Semantic Versioning 2.0.0](https://semver.org/lang/zh-CN/).
## Details
### [v3.6.5](https://github.com/vant-ui/vant/compare/v3.6.4...v3.6.5)
`2022-11-08`
**Feature**
- ImagePreview: add preview image slot [#11133](https://github.com/vant-ui/vant/issues/11133)
**Bug Fixes**
- lazyload: lazy-image h is not a function [#11230](https://github.com/vant-ui/vant/issues/11230)
### [v3.6.4](https://github.com/vant-ui/vant/compare/v3.6.3...v3.6.4)
`2022-10-07`

View File

@ -19,6 +19,18 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。
## 更新内容
### [v3.6.5](https://github.com/vant-ui/vant/compare/v3.6.4...v3.6.5)
`2022-11-08`
**Feature**
- ImagePreview: 新增 preview image 插槽 [#11133](https://github.com/vant-ui/vant/issues/11133)
**Bug Fixes**
- lazyload: 修复使用 lazy-image 时提示 h is not a function 的问题 [#11230](https://github.com/vant-ui/vant/issues/11230)
### [v3.6.4](https://github.com/vant-ui/vant/compare/v3.6.3...v3.6.4)
`2022-10-07`

View File

@ -1,6 +1,6 @@
{
"name": "vant",
"version": "3.6.4",
"version": "3.6.5",
"description": "Lightweight Mobile UI Components built on Vue",
"main": "lib/vant.cjs.js",
"module": "es/index.mjs",

View File

@ -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: {
@ -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() {