mirror of
https://github.com/youzan/vant.git
synced 2025-10-18 17:51:54 +00:00
[Doc] ts import plugin (#1230)
This commit is contained in:
@@ -81,6 +81,8 @@ Then you can import components from vant, equivalent to import manually below.
|
||||
import { Button } from 'vant';
|
||||
```
|
||||
|
||||
> If you are using TypeScript,please use [ts-import-plugin](https://github.com/Brooooooklyn/ts-import-plugin) instead
|
||||
|
||||
#### 2. Manually import
|
||||
|
||||
```js
|
||||
|
@@ -82,6 +82,8 @@ npm i babel-plugin-import -D
|
||||
import { Button } from 'vant';
|
||||
```
|
||||
|
||||
> 如果你在使用 TypeScript,可以使用 [ts-import-plugin](https://github.com/Brooooooklyn/ts-import-plugin) 实现按需引入
|
||||
|
||||
#### 方式二. 按需引入组件
|
||||
|
||||
在不使用插件的情况下,可以手动引入需要的组件
|
||||
|
@@ -62,6 +62,8 @@ Then you can import components from vant, equivalent to import manually below.
|
||||
import { Button } from 'vant';
|
||||
```
|
||||
|
||||
> If you are using TypeScript,please use [ts-import-plugin](https://github.com/Brooooooklyn/ts-import-plugin) instead
|
||||
|
||||
#### 2. Manually import
|
||||
|
||||
```js
|
||||
|
@@ -66,6 +66,8 @@ npm i babel-plugin-import -D
|
||||
import { Button, Cell } from 'vant';
|
||||
```
|
||||
|
||||
> 如果你在使用 TypeScript,可以使用 [ts-import-plugin](https://github.com/Brooooooklyn/ts-import-plugin) 实现按需引入
|
||||
|
||||
#### 方式二. 按需引入组件
|
||||
|
||||
在不使用插件的情况下,可以手动引入需要的组件
|
||||
|
Reference in New Issue
Block a user