Skip to content

Commit

Permalink
Merge pull request #100 from ly525/patch-1
Browse files Browse the repository at this point in the history
docs: Update block.md
  • Loading branch information
w3cmark authored Jan 6, 2020
2 parents f9fc9ff + 2a85a29 commit c5d7459
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/zh-CN/api/block.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ ams.block('formView', {
以上注册了 `formView` block

## 使用 block
> 注意:如果在 template 中使用 `<ams-block />`,需要先在 `main.js` 中安装 `ams`,引入 ams 中的区块和字段。文档参见[通过npm安装](https://vipshop.github.io/ams/api/#%E4%BD%BF%E7%94%A8%E6%96%B9%E5%BC%8F)
```js
import ams from '@ams-team/ams';
Vue.use(ams); // 类似 Vue.use(element-ui);
```

每个block本质都是[Vue组件](https://cn.vuejs.org/v2/guide/components-registration.html),可以通过区块名 `name` 来引用:`<ams-block name="formView" />`,完整示例如下:

Expand Down

0 comments on commit c5d7459

Please sign in to comment.