diff --git a/src/router/index.ts b/src/router/index.ts index 14afeb389..6028c988f 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -249,6 +249,7 @@ const router = createRouter({ meta: { showAsModal: true, }, + props: route => ({ namespaceId: Number(route.params.id as string) }), }, { path: '/tasks/:id', diff --git a/src/views/namespaces/settings/archive.vue b/src/views/namespaces/settings/archive.vue index 950c1c126..08c041b8e 100644 --- a/src/views/namespaces/settings/archive.vue +++ b/src/views/namespaces/settings/archive.vue @@ -22,7 +22,7 @@ export default { name: 'namespace-setting-archive' } -export default defineComponent({ - name: 'namespace-setting-delete', - computed: { - namespace() { - return this.$store.getters['namespaces/getNamespaceById'](this.$route.params.id) - }, - title() { - if (!this.namespace) { - return - } - return this.$t('namespace.delete.title', {namespace: this.namespace.title}) - }, - }, - watch: { - title: { - handler(title) { - setTitle(title) - }, - immediate: true, - }, - }, - methods: { - async deleteNamespace() { - await this.$store.dispatch('namespaces/deleteNamespace', this.namespace) - this.$message.success({message: this.$t('namespace.delete.success')}) - this.$router.push({name: 'home'}) - }, +