mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-26 03:52:23 -08:00
refactor(editor): Migrate ErrorView component to Vue 3 (no-changelog) (#9740)
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
parent
c8f0029bc5
commit
d62ca78a4c
|
@ -17,34 +17,22 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
<script setup lang="ts">
|
||||
import type { BaseTextKey } from '@/plugins/i18n';
|
||||
import { type PropType, defineComponent } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { VIEWS } from '@/constants';
|
||||
const router = useRouter();
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ErrorView',
|
||||
props: {
|
||||
messageKey: {
|
||||
type: String as PropType<BaseTextKey>,
|
||||
required: true,
|
||||
},
|
||||
errorCode: {
|
||||
type: Number,
|
||||
},
|
||||
redirectTextKey: {
|
||||
type: String as PropType<BaseTextKey>,
|
||||
required: true,
|
||||
},
|
||||
redirectPage: {
|
||||
type: String,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onButtonClick() {
|
||||
void this.$router.push({ name: this.redirectPage });
|
||||
},
|
||||
},
|
||||
});
|
||||
const props = defineProps<{
|
||||
messageKey: BaseTextKey;
|
||||
errorCode: number;
|
||||
redirectTextKey: BaseTextKey;
|
||||
redirectPage?: keyof typeof VIEWS;
|
||||
}>();
|
||||
|
||||
function onButtonClick() {
|
||||
void router.push({ name: props.redirectPage ?? VIEWS.HOMEPAGE });
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
|
|
Loading…
Reference in a new issue