Просмотр исходного кода

代码生成:Vue2 界面:修正 $refs

puhui999 1 год назад
Родитель
Сommit
4f42e7ca68

+ 4 - 0
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngine.java

@@ -297,6 +297,10 @@ public class CodegenEngine {
         if (StrUtil.count(content, "dateFormatter") == 1) {
             content = StrUtils.removeLineContains(content, "dateFormatter");
         }
+        // Vue2 界面:修正 $refs
+        if (StrUtil.count(content, "this.refs") >= 1) {
+            content = content.replace("this.refs", "this.$refs");
+        }
         // Vue 界面:去除多的 dict 相关,只有一个的情况下,说明没使用到
         if (StrUtil.count(content, "getIntDictOptions") == 1) {
             content = content.replace("getIntDictOptions, ", "");