diff --git a/src/utils/generator/parser.jsx b/src/utils/generator/parser.jsx index 58fb29a..748be8e 100644 --- a/src/utils/generator/parser.jsx +++ b/src/utils/generator/parser.jsx @@ -71,6 +71,7 @@ function renderFrom(h) { label-width={`${formConfCopy.labelWidth}px`} ref={formConfCopy.formRef} // model不能直接赋值 https://github.com/vuejs/jsx/issues/49#issuecomment-472013664 + model={this[formConfCopy.formModel]} props={{ model: this[formConfCopy.formModel] }} rules={this[formConfCopy.formRules]} > @@ -113,8 +114,8 @@ function renderChildren(h, scheme) { } function setValue(event, config, scheme) { - this.$set(config, "defaultValue", event); - this.$set(this[this.formConf.formModel], scheme.__vModel__, event); + config.defaultValue = event; + this[this.formConf.formModel][scheme.__vModel__] = event; } function buildListeners(scheme) { @@ -142,6 +143,7 @@ export default defineComponent({ required: true, }, }, + emits: ["submit", "getData"], data() { const data = { formConfCopy: deepClone(this.formConf), @@ -189,12 +191,13 @@ export default defineComponent({ } }); }, + // 特殊处理的 Option buildOptionMethod(scheme) { const config = scheme.__config__; if (config && config.tag === "el-cascader") { if (config.dataType === "dynamic") { - this.$axios({ + axios({ method: config.method, url: config.url, }).then((resp) => { diff --git a/src/utils/generator/render.jsx b/src/utils/generator/render.jsx index e5dd15f..5eb9526 100644 --- a/src/utils/generator/render.jsx +++ b/src/utils/generator/render.jsx @@ -58,7 +58,6 @@ function vModel(dataObject, defaultValue) { this.$emit("input", val); }; dataObject.on.change = (val) => { - console.log(val, "change"); this.$emit("input", val); }; } @@ -68,7 +67,6 @@ function mountSlotFiles(confClone, children) { if (childObjs) { Object.keys(childObjs).forEach((key) => { const childFunc = childObjs[key]; - console.log(childFunc); if (confClone.__slot__ && confClone.__slot__[key]) { children.push(childFunc(confClone, key)); } @@ -220,7 +218,6 @@ export default defineComponent({ render() { const dataObject = makeDataObject(); const confClone = deepClone(this.$props.conf); - console.log(this.$slots.default, "lot"); const children = []; // 如果slots文件夹存在与当前tag同名的文件,则执行文件中的代码 mountSlotFiles(confClone, children); diff --git a/src/views/flowable/category/index.vue b/src/views/flowable/category/index.vue index cee7dc5..b4d585e 100644 --- a/src/views/flowable/category/index.vue +++ b/src/views/flowable/category/index.vue @@ -171,6 +171,7 @@