mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script setup lang="ts">
|
||||||
import type { BaseTextKey } from '@/plugins/i18n';
|
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({
|
const props = defineProps<{
|
||||||
name: 'ErrorView',
|
messageKey: BaseTextKey;
|
||||||
props: {
|
errorCode: number;
|
||||||
messageKey: {
|
redirectTextKey: BaseTextKey;
|
||||||
type: String as PropType<BaseTextKey>,
|
redirectPage?: keyof typeof VIEWS;
|
||||||
required: true,
|
}>();
|
||||||
},
|
|
||||||
errorCode: {
|
function onButtonClick() {
|
||||||
type: Number,
|
void router.push({ name: props.redirectPage ?? VIEWS.HOMEPAGE });
|
||||||
},
|
}
|
||||||
redirectTextKey: {
|
|
||||||
type: String as PropType<BaseTextKey>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
redirectPage: {
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
onButtonClick() {
|
|
||||||
void this.$router.push({ name: this.redirectPage });
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" module>
|
<style lang="scss" module>
|
||||||
|
|
Loading…
Reference in a new issue