docs: add component registration link (#8378)

This commit is contained in:
neverland
2021-03-18 11:23:49 +08:00
committed by GitHub
parent 8643ffdb8d
commit f7706fb179
132 changed files with 264 additions and 2 deletions

View File

@@ -21,11 +21,11 @@ import { createApp } from 'vue';
const app = createApp();
// 方式一. 通过 app.use 注册
// 注册完成后,在模板中通过 VanButton 或 van-button 标签均可使用按钮组件
// 注册完成后,在模板中通过 <van-button><VanButton> 标签使用按钮组件
app.use(Button);
// 方式二. 通过 app.component 注册
// 注册完成后,在模板中通过 van-button 标签即可使用按钮组件
// 注册完成后,在模板中通过 <van-button> 标签使用按钮组件
app.component(Button.name, Button);
```