docs(Lazyload): use composition api

This commit is contained in:
chenjiahan 2020-12-13 14:04:56 +08:00
parent 7537370343
commit af49575484
3 changed files with 20 additions and 15 deletions

View File

@ -25,7 +25,7 @@ app.use(Lazyload, {
```js
export default {
data() {
setup() {
return {
imageList: [
'https://img.yzcdn.cn/vant/apple-1.jpg',

View File

@ -29,7 +29,7 @@ app.use(Lazyload, {
```js
export default {
data() {
setup() {
return {
imageList: [
'https://img.yzcdn.cn/vant/apple-1.jpg',

View File

@ -18,21 +18,26 @@
</demo-block>
</template>
<script>
export default {
i18n: {
'zh-CN': {
title2: '背景图懒加载',
title3: '懒加载模块',
},
'en-US': {
title2: 'Lazyload Background Image',
title3: 'Lazyload Component',
},
},
<script lang="ts">
import { useTranslate } from '@demo/use-translate';
const i18n = {
'zh-CN': {
title2: '背景图懒加载',
title3: '懒加载模块',
},
'en-US': {
title2: 'Lazyload Background Image',
title3: 'Lazyload Component',
},
};
export default {
setup() {
const t = useTranslate(i18n);
data() {
return {
t,
imageList: [
'https://img.yzcdn.cn/vant/apple-1.jpg',
'https://img.yzcdn.cn/vant/apple-2.jpg',