mirror of
https://github.com/youzan/vant.git
synced 2025-12-24 02:02:09 +08:00
[Doc] update README.md and quickstart
This commit is contained in:
@@ -29,17 +29,6 @@ npm i vant -S
|
||||
npm i vant@beta -S
|
||||
```
|
||||
|
||||
### CDN
|
||||
|
||||
```html
|
||||
<!-- import style -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@beta/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@beta/lib/vant.min.js"></script>
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### 1. Import on demand
|
||||
@@ -102,6 +91,28 @@ Vue.use(Vant);
|
||||
|
||||
> If you configured babel-plugin-import, you won't be allowed to import all components.
|
||||
|
||||
### 4. CDN
|
||||
|
||||
```html
|
||||
<!-- import style -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@beta/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@beta/lib/vant.min.js"></script>
|
||||
|
||||
<script>
|
||||
var Vue = window.Vue;
|
||||
var vant = window.vant;
|
||||
|
||||
// Register components
|
||||
Vue.use(vant);
|
||||
|
||||
// Call function components
|
||||
vant.Toast('message');
|
||||
</script>
|
||||
```
|
||||
|
||||
## Other
|
||||
|
||||
### Rem units
|
||||
|
||||
Reference in New Issue
Block a user