|
|
@@ -476,12 +476,6 @@
|
|
|
templatePreviewRequestToken += 1;
|
|
|
}
|
|
|
});
|
|
|
- watch(categories, (nextCategories) => {
|
|
|
- if (!nextCategories.includes(activeCategory.value)) {
|
|
|
- activeCategory.value = DEFAULT_TEMPLATE_CATEGORY;
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
const activeNodeInfo = computed(() => {
|
|
|
return activeNodeKey.value ? findTreeNodeByKey(treeData.value, activeNodeKey.value)?.raw || null : null;
|
|
|
});
|
|
|
@@ -748,6 +742,13 @@
|
|
|
templateSearchBaseList,
|
|
|
} = templateApi;
|
|
|
|
|
|
+ // categories 依赖 templateApi 解构出的 ref,必须在解构之后注册,否则 setup 期首次求值触发 TDZ 报错
|
|
|
+ watch(categories, (nextCategories) => {
|
|
|
+ if (!nextCategories.includes(activeCategory.value)) {
|
|
|
+ activeCategory.value = DEFAULT_TEMPLATE_CATEGORY;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
// 既有域:mappingApi
|
|
|
const mappingApi = useFieldMapping({
|
|
|
activeNodeInfo,
|