frontend/src/components/rule/RuleWrapper.vue in mihari-5.2.4 vs frontend/src/components/rule/RuleWrapper.vue in mihari-5.3.0
- old
+ new
@@ -1,62 +1,55 @@
<template>
<Loading v-if="getRuleTask.isRunning"></Loading>
- <ErrorMessage
- v-if="getRuleTask.isError"
- :error="getRuleTask.last?.error"
- ></ErrorMessage>
+ <ErrorMessage v-if="getRuleTask.isError" :error="getRuleTask.last?.error"></ErrorMessage>
- <Rule
- :rule="getRuleTask.last.value"
- @refresh="refresh"
- v-if="getRuleTask.last?.value"
- ></Rule>
+ <Rule :rule="getRuleTask.last.value" @refresh="refresh" v-if="getRuleTask.last?.value"></Rule>
</template>
<script lang="ts">
-import { defineComponent, onMounted, watch } from "vue";
+import { defineComponent, onMounted, watch } from "vue"
-import { generateGetRuleTask } from "@/api-helper";
-import ErrorMessage from "@/components/ErrorMessage.vue";
-import Loading from "@/components/Loading.vue";
-import Rule from "@/components/rule/Rule.vue";
+import { generateGetRuleTask } from "@/api-helper"
+import ErrorMessage from "@/components/ErrorMessage.vue"
+import Loading from "@/components/Loading.vue"
+import Rule from "@/components/rule/Rule.vue"
export default defineComponent({
name: "RuleWrapper",
components: {
Rule,
Loading,
- ErrorMessage,
+ ErrorMessage
},
props: {
id: {
type: String,
- required: true,
- },
+ required: true
+ }
},
setup(props) {
- const getRuleTask = generateGetRuleTask();
+ const getRuleTask = generateGetRuleTask()
const getRule = async () => {
- await getRuleTask.perform(props.id);
- };
+ await getRuleTask.perform(props.id)
+ }
const refresh = async () => {
- await getRule();
- };
+ await getRule()
+ }
onMounted(async () => {
- await getRule();
- });
+ await getRule()
+ })
watch(props, async () => {
- await getRule();
- });
+ await getRule()
+ })
return {
getRuleTask,
- refresh,
- };
- },
-});
+ refresh
+ }
+ }
+})
</script>