Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion mockServer/src/mock/get/app-center/v1/apps/schema/918.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion mockServer/src/services/appinfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@ export default () => {

const stores = useStores()

return { t: i18n.global.t, stores, lowcodeWrap, utils }
return { t: i18n.global.t, stores, lowcodeWrap }
}
6 changes: 5 additions & 1 deletion packages/vue-generator/src/generator/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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}
Expand Down