mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
docs: update cdn guide
This commit is contained in:
parent
dccacaaf1f
commit
64c650d0ba
@ -102,19 +102,20 @@ The easiest way to use Vant is to include a CDN link in the html file, after whi
|
||||
<!-- import style -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/vant@2.9/lib/index.css"
|
||||
href="https://cdn.jsdelivr.net/npm/vant@next/lib/index.css"
|
||||
/>
|
||||
|
||||
<!-- import script -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vant@2.9/lib/vant.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue@next"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vant@next/lib/vant.min.js"></script>
|
||||
|
||||
<script>
|
||||
// Render the Button component
|
||||
new Vue({
|
||||
el: '#app',
|
||||
const app = Vue.createApp({
|
||||
template: `<van-button>Button</van-button>`,
|
||||
});
|
||||
app.use(vant);
|
||||
app.mount('#app');
|
||||
|
||||
// Call function component
|
||||
vant.Toast('Message');
|
||||
|
@ -119,19 +119,20 @@ app.use(Vant);
|
||||
<!-- 引入样式文件 -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/vant@2.9/lib/index.css"
|
||||
href="https://cdn.jsdelivr.net/npm/vant@next/lib/index.css"
|
||||
/>
|
||||
|
||||
<!-- 引入 Vue 和 Vant 的 JS 文件 -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vant@2.9/lib/vant.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue@next"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vant@next/lib/vant.min.js"></script>
|
||||
|
||||
<script>
|
||||
// 在 #app 标签下渲染一个按钮组件
|
||||
new Vue({
|
||||
el: '#app',
|
||||
const app = Vue.createApp({
|
||||
template: `<van-button>按钮</van-button>`,
|
||||
});
|
||||
app.use(vant);
|
||||
app.mount('#app');
|
||||
|
||||
// 调用函数组件,弹出一个 Toast
|
||||
vant.Toast('提示');
|
||||
|
Loading…
x
Reference in New Issue
Block a user