mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
docs(quickstart): add register Lazyload guide (#6110)
This commit is contained in:
parent
3d3ad38443
commit
8a1d52a6a3
@ -115,6 +115,9 @@ The easiest way to use Vant is to include a CDN link in the html file, after whi
|
|||||||
|
|
||||||
// Call function component
|
// Call function component
|
||||||
vant.Toast('Message');
|
vant.Toast('Message');
|
||||||
|
|
||||||
|
// Register Lazyload directive
|
||||||
|
Vue.use(vant.Lazyload);
|
||||||
</script>
|
</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -132,6 +132,10 @@ Vue.use(Vant);
|
|||||||
|
|
||||||
// 调用函数组件,弹出一个 Toast
|
// 调用函数组件,弹出一个 Toast
|
||||||
vant.Toast('提示');
|
vant.Toast('提示');
|
||||||
|
|
||||||
|
// 通过 CDN 引入时不会自动注册 Lazyload 组件
|
||||||
|
// 可以通过下面的方式手动注册
|
||||||
|
Vue.use(vant.Lazyload);
|
||||||
</script>
|
</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -45,8 +45,8 @@ yarn add @vant/cli --dev
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"*.{ts,tsx,js,jsx,vue}": ["eslint", "git add"],
|
"*.{js,jsx,ts,tsx,vue}": "eslint --fix",
|
||||||
"*.{vue,css,less,scss}": ["stylelint", "git add"]
|
"*.{vue,css,less,scss}": "stylelint --fix"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
"root": true,
|
"root": true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user