Browse Source

[FIx][UI Next][V1.0.0-Alpha] Fix the error message while opening the task definition page (#8814)

Amy0104 3 years ago
parent
commit
53fcffedb6

+ 3 - 12
dolphinscheduler-ui-next/src/views/projects/task/definition/components/version-modal.tsx

@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-import { defineComponent, onMounted, PropType, toRefs, watch } from 'vue'
+import { defineComponent, PropType, toRefs, watch } from 'vue'
 import Modal from '@/components/modal'
 import { NDataTable, NPagination } from 'naive-ui'
 import { useI18n } from 'vue-i18n'
@@ -48,21 +48,12 @@ const VersionModal = defineComponent({
       })
     }
 
-    onMounted(() => {
-      variables.taskVersion = props.row?.taskVersion
-      variables.taskCode = props.row?.taskCode
-
-      createColumns(variables)
-      requestData()
-    })
-
     watch(
       () => props.show,
       () => {
-        variables.taskVersion = props.row?.taskVersion
-        variables.taskCode = props.row?.taskCode
-
         if (props.show) {
+          variables.taskVersion = props.row?.taskVersion
+          variables.taskCode = props.row?.taskCode
           createColumns(variables)
           requestData()
         }