修正表单页getTitle未动态生效问题 #I4QXTJ

This commit is contained in:
thinkgem
2022-01-15 21:47:01 +08:00
parent c1f0f8e581
commit 77a2d6ea66

View File

@@ -51,7 +51,7 @@
});
</script>
<script lang="ts" setup>
import { defineComponent, ref } from 'vue';
import { defineComponent, ref, computed } from 'vue';
import { useI18n } from '/@/hooks/web/useI18n';
import { useMessage } from '/@/hooks/web/useMessage';
import { router } from '/@/router';
@@ -90,10 +90,10 @@ for(c in table.columnList){
const { t } = useI18n('${moduleName}${isNotEmpty(subModuleName)?'.'+subModuleName:''}.${className}');
const { showMessage } = useMessage();
const record = ref<Recordable>({});
const getTitle = {
const getTitle = computed(() => ({
icon: router.currentRoute.value.meta.icon || 'ant-design:book-outlined',
value: record.value.isNewRecord ? t('新增${functionNameSimple}') : t('编辑${functionNameSimple}'),
};
}));
const inputFormSchemas: FormSchema[] = [
<% if(table.isTreeEntity){ %>