(2). 业务场景:
<component :is="currentConfig" :config="config"></component>
export default {
name: 'App',
components: {
rxTextboxConfig,
rxTextareaConfig,
},
mouted: {
this.currentConfig = ctlType + "-config"
if (ctlType == "rx-textbox") {
this.config.type = "VARCHAR"
}
if (ctlType == "rx-textarea") {
this.config.name = "我是富文本框"
}
}
}
- 开发表单的过程中,会有很多类型的控件:文本框、下拉框等:
a. 常规方案:v-if来实现.
b. 推荐:控件配置文件,用于不同的配置组件来实现.