refactor: vue3.3 defineOptions

This commit is contained in:
shizhong
2023-09-22 14:00:50 +08:00
parent 20f483f561
commit 7e5ad60d1d
23 changed files with 122 additions and 104 deletions

View File

@ -14,8 +14,6 @@
</template>
<script lang="ts" setup>
import type { FormRules } from 'element-plus'
import { ElMessage } from 'element-plus'
import { FormSchema } from '@/types/form'
import type { FormExpose } from '@/components/Form'
import {
@ -27,6 +25,7 @@ import {
defineOptions({ name: 'BasicInfo' })
const { t } = useI18n()
const message = useMessage() // 消息弹窗
// 表单校验
const rules = reactive<FormRules>({
nickname: [{ required: true, message: t('profile.rules.nickname'), trigger: 'blur' }],
@ -78,7 +77,7 @@ const submit = () => {
if (valid) {
const data = unref(formRef)?.formModel as UserProfileUpdateReqVO
await updateUserProfileApi(data)
ElMessage.success(t('common.updateSuccess'))
message.success(t('common.updateSuccess'))
await init()
}
})

View File

@ -81,7 +81,7 @@ onMounted(async () => {
}
.list-group {
padding-left: 0px;
padding-left: 0;
list-style: none;
}
@ -89,7 +89,7 @@ onMounted(async () => {
border-bottom: 1px solid #e7eaec;
border-top: 1px solid #e7eaec;
margin-bottom: -1px;
padding: 11px 0px;
padding: 11px 0;
font-size: 13px;
}