docs(Lazyload): add CDN faq (#9031)

This commit is contained in:
neverland 2021-07-15 10:33:30 +08:00 committed by GitHub
parent d74a3c0b29
commit c55ab9611f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -87,3 +87,17 @@ app.use(Lazyload, {
| lazyComponent | 是否能懒加载模块 | _boolean_ | `false` |
> 更多内容请参照:[vue-lazyload 官方文档](https://github.com/hilongjw/vue-lazyload)
## 常见问题
### 通过 CDN 引入 Vant 时,没有自动注册 Lazyload 组件?
由于 Lazyload 组件在注册时可以传入一些配置项,所以我们不会自动注册 Lazyload 组件,需要手动进行注册:
```js
const app = Vue.createApp();
app.use(vant.Lazyload, {
lazyComponent: true,
});
```