wiz-frameworks
Version:
wizlong react framework
41 lines (30 loc) • 927 B
Markdown
#通用配置化配置详解
## 一、概念
为了加速开发代码的编写,方便配置化开发,所以引入模版(template)的概念。
## 二、使用方式
### 1、框架初始化引入方式
框架初始化时会将wiz-components的组件引入到template中,通过配置可以实现调用,也支持自定义组件的引入。
```js
//框架初始化 自定义组件引入
import {Custom} from 'CustomComponent';
init({
template:{ Custom }
})
```
### 2、调用方式
调用时通过框架提供的templateUtils进行调用
```js
import { WizContainer, templateUtils } from 'wiz-frameworks'
class TemplateDemo export WizContainer {
return templateUtils.getComponentByConfig([
{
name: 'WizCard',
params: {
title: ' 卡片 ',
style: { width: 300, margin: 30 },
children: [<div>允许自定义的内容</div>]
}
}
])
}
```