forked from opentiny/tiny-engine
fix:组件属性绑定工具类utils,修改预览出码实现 (#93)
This commit is contained in:
parent
6a4de499a4
commit
a6232e5c92
|
@ -102,7 +102,7 @@
|
|||
"type": "function",
|
||||
"content": {
|
||||
"type": "JSFunction",
|
||||
"value": "function util() {\r\n console.log(3211)\r\n}"
|
||||
"value": "function test() {\r\n return 'test'\r\n}"
|
||||
},
|
||||
"app": 918,
|
||||
"category": "utils",
|
||||
|
|
|
@ -1404,7 +1404,7 @@
|
|||
"type": "function",
|
||||
"content": {
|
||||
"type": "JSFunction",
|
||||
"value": "function util() {\r\n console.log(3211)\r\n}"
|
||||
"value": "function test() {\r\n return 'test'\r\n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
@ -1057,7 +1057,7 @@
|
|||
"type": "function",
|
||||
"content": {
|
||||
"type": "JSFunction",
|
||||
"value": "function util() {\r\n console.log(3211)\r\n}"
|
||||
"value": "function test() {\r\n return 'test'\r\n}"
|
||||
},
|
||||
"app": 918,
|
||||
"category": "utils",
|
||||
|
|
|
@ -88,5 +88,5 @@ export default () => {
|
|||
|
||||
const stores = useStores()
|
||||
|
||||
return { t: i18n.global.t, stores, lowcodeWrap, utils }
|
||||
return { t: i18n.global.t, stores, lowcodeWrap }
|
||||
}
|
||||
|
|
|
@ -41,6 +41,10 @@ function recurseChildren(children, state, description, result) {
|
|||
result.push(subTemplate)
|
||||
} else if (children?.type === 'JSExpression') {
|
||||
result.push(`{{ ${children.value.replace(/this\.(props\.)?/g, '')} }}`)
|
||||
|
||||
for (const key in description.jsResource) {
|
||||
description.jsResource[key] = description.jsResource[key] || children.value.includes(`.${key}.`)
|
||||
}
|
||||
} else if (children?.type === 'i18n') {
|
||||
result.push(`{{ t('${children.key}') }}`)
|
||||
} else {
|
||||
|
@ -398,7 +402,7 @@ ${imports.join('\n')}
|
|||
const props = defineProps({${propsArr.join(',\n')}})
|
||||
const emit = defineEmits(${JSON.stringify(emitsArr)})
|
||||
|
||||
const { t, lowcodeWrap, stores, utils } = vue.inject(I18nInjectionKey).lowcode()
|
||||
const { t, lowcodeWrap, stores } = vue.inject(I18nInjectionKey).lowcode()
|
||||
const wrap = lowcodeWrap(props, { emit }, t)
|
||||
|
||||
${iconStatement}
|
||||
|
|
Loading…
Reference in New Issue