mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
docs(Lazyload): use composition api
This commit is contained in:
parent
7537370343
commit
af49575484
@ -25,7 +25,7 @@ app.use(Lazyload, {
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
export default {
|
export default {
|
||||||
data() {
|
setup() {
|
||||||
return {
|
return {
|
||||||
imageList: [
|
imageList: [
|
||||||
'https://img.yzcdn.cn/vant/apple-1.jpg',
|
'https://img.yzcdn.cn/vant/apple-1.jpg',
|
||||||
|
@ -29,7 +29,7 @@ app.use(Lazyload, {
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
export default {
|
export default {
|
||||||
data() {
|
setup() {
|
||||||
return {
|
return {
|
||||||
imageList: [
|
imageList: [
|
||||||
'https://img.yzcdn.cn/vant/apple-1.jpg',
|
'https://img.yzcdn.cn/vant/apple-1.jpg',
|
||||||
|
@ -18,21 +18,26 @@
|
|||||||
</demo-block>
|
</demo-block>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
export default {
|
import { useTranslate } from '@demo/use-translate';
|
||||||
i18n: {
|
|
||||||
'zh-CN': {
|
const i18n = {
|
||||||
title2: '背景图懒加载',
|
'zh-CN': {
|
||||||
title3: '懒加载模块',
|
title2: '背景图懒加载',
|
||||||
},
|
title3: '懒加载模块',
|
||||||
'en-US': {
|
},
|
||||||
title2: 'Lazyload Background Image',
|
'en-US': {
|
||||||
title3: 'Lazyload Component',
|
title2: 'Lazyload Background Image',
|
||||||
},
|
title3: 'Lazyload Component',
|
||||||
},
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setup() {
|
||||||
|
const t = useTranslate(i18n);
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
return {
|
||||||
|
t,
|
||||||
imageList: [
|
imageList: [
|
||||||
'https://img.yzcdn.cn/vant/apple-1.jpg',
|
'https://img.yzcdn.cn/vant/apple-1.jpg',
|
||||||
'https://img.yzcdn.cn/vant/apple-2.jpg',
|
'https://img.yzcdn.cn/vant/apple-2.jpg',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user