Skip to content

Commit

Permalink
Merge pull request #86 from zhanxu33/develop
Browse files Browse the repository at this point in the history
发布体验问题
  • Loading branch information
terlinhe authored Jun 10, 2022
2 parents 9d104e6 + 71677a4 commit 16e98e0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
9 changes: 6 additions & 3 deletions lib/client/src/components/render/html.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,18 @@
},
updateMethods () {
(this.renderOptions.methodCode || []).forEach((method) => {
if (this.renderOptions?.methodCode?.length > 0) {
let parent = this.$parent
while (parent && parent._uid !== this.parentId) {
parent = parent.$parent
}
if (parent) {
this[method] = parent[method]
const userKeys = Object.keys(parent).filter((key) => /^[^_$]/.test(key)) || []
userKeys.forEach((userKey) => {
this[userKey] = parent[userKey]
})
}
})
}
}
},
Expand Down
6 changes: 5 additions & 1 deletion lib/client/src/components/render/pc/render-slot.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export default {
} while (curSlot && Object.keys(curSlot).length > 0)

const html = `<render-slot>${render(...slotRenderParams, key)}</render-slot>`
return transformHtmlToVnode(html).children
const slotChildrenInstance = transformHtmlToVnode(html).children || []
slotChildrenInstance?.forEach((vnode) => {
vnode.key = vnode.key + key
})
return slotChildrenInstance
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
ghost-class="block-item-ghost"
:list="formItemList"
handle=".option-col-drag"
:group="{ name: 'form-item-list', pull: false, put: false }"
@change="handleSort">
<transition-group
type="transition"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ const checkValueConfig = rootNode => {
const checkRemote = (data, componentId, name) => {
// 兼容 methodCode 平铺的老数据
let methodData = data?.payload?.methodData
if (typeof methodData === 'string') {
if (data?.payload?.methodCode) {
methodData = {
methodCode: methodData
methodCode: data?.payload?.methodCode
}
}
if (data.valueType === 'remote' && !methodData.methodCode) {
if (data.valueType === 'remote' && !methodData?.methodCode) {
errorStack.push(`组件【${componentId}】的【${name}】的属性初始值来源配置为函数,但没有选择函数`)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,18 @@
},
updateMethods () {
(this.renderOptions.methodCode || []).forEach((method) => {
if (this.renderOptions?.methodCode?.length > 0) {
let parent = this.$parent
while (parent && parent._uid !== this.parentId) {
parent = parent.$parent
}
if (parent) {
this[method] = parent[method]
const userKeys = Object.keys(parent).filter((key) => /^[^_$]/.test(key)) || []
userKeys.forEach((userKey) => {
this[userKey] = parent[userKey]
})
}
})
}
}
},
Expand Down

0 comments on commit 16e98e0

Please sign in to comment.