|
|
@ -1,4 +1,5 @@ |
|
|
|
<script lang="ts" setup> |
|
|
|
<script lang="ts" setup> |
|
|
|
|
|
|
|
import { Input } from 'ant-design-vue' |
|
|
|
import type { Form } from 'ant-design-vue' |
|
|
|
import type { Form } from 'ant-design-vue' |
|
|
|
import type { RuleObject } from 'ant-design-vue/es/form' |
|
|
|
import type { RuleObject } from 'ant-design-vue/es/form' |
|
|
|
import type { VNodeRef } from '@vue/runtime-core' |
|
|
|
import type { VNodeRef } from '@vue/runtime-core' |
|
|
@ -8,7 +9,9 @@ import { |
|
|
|
navigateTo, |
|
|
|
navigateTo, |
|
|
|
projectTitleValidator, |
|
|
|
projectTitleValidator, |
|
|
|
reactive, |
|
|
|
reactive, |
|
|
|
|
|
|
|
onMounted, |
|
|
|
ref, |
|
|
|
ref, |
|
|
|
|
|
|
|
generateUniqueName, |
|
|
|
useApi, |
|
|
|
useApi, |
|
|
|
useNuxtApp, |
|
|
|
useNuxtApp, |
|
|
|
useSidebar, |
|
|
|
useSidebar, |
|
|
@ -31,7 +34,7 @@ const nameValidationRules = [ |
|
|
|
const form = ref<typeof Form>() |
|
|
|
const form = ref<typeof Form>() |
|
|
|
|
|
|
|
|
|
|
|
const formState = reactive({ |
|
|
|
const formState = reactive({ |
|
|
|
title: '', |
|
|
|
title: '' |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const createProject = async () => { |
|
|
|
const createProject = async () => { |
|
|
@ -47,7 +50,14 @@ const createProject = async () => { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const focus: VNodeRef = (el) => (el as HTMLInputElement)?.focus() |
|
|
|
const focus: VNodeRef = (el: typeof Input) => { |
|
|
|
|
|
|
|
el?.$el?.focus() |
|
|
|
|
|
|
|
el?.$el?.select() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(async () => { |
|
|
|
|
|
|
|
formState.title = await generateUniqueName() |
|
|
|
|
|
|
|
}) |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|