refactor: vue3.3 defineOptions

This commit is contained in:
shizhong
2023-09-22 12:49:25 +08:00
parent 6ec2ee8af4
commit 20f483f561
189 changed files with 589 additions and 187 deletions

View File

@ -12,7 +12,7 @@
<XButton :title="t('common.reset')" type="danger" @click="init()" />
</div>
</template>
<script lang="ts" name="BasicInfo" setup>
<script lang="ts" setup>
import type { FormRules } from 'element-plus'
import { ElMessage } from 'element-plus'
@ -24,6 +24,8 @@ import {
UserProfileUpdateReqVO
} from '@/api/system/user/profile'
defineOptions({ name: 'BasicInfo' })
const { t } = useI18n()
// 表单校验
const rules = reactive<FormRules>({

View File

@ -46,12 +46,14 @@
</ul>
</div>
</template>
<script lang="ts" name="ProfileUser" setup>
<script lang="ts" setup>
import { formatDate } from '@/utils/formatTime'
import UserAvatar from './UserAvatar.vue'
import { getUserProfileApi, ProfileVO } from '@/api/system/user/profile'
defineOptions({ name: 'ProfileUser' })
const { t } = useI18n()
const userInfo = ref<ProfileVO>()
const getUserInfo = async () => {

View File

@ -15,12 +15,14 @@
</el-form-item>
</el-form>
</template>
<script lang="ts" name="ResetPwd" setup>
<script lang="ts" setup>
import type { FormInstance, FormRules } from 'element-plus'
import { InputPassword } from '@/components/InputPassword'
import { updateUserPwdApi } from '@/api/system/user/profile'
defineOptions({ name: 'ResetPwd' })
const { t } = useI18n()
const message = useMessage()
const formRef = ref<FormInstance>()

View File

@ -10,10 +10,12 @@
/>
</div>
</template>
<script lang="ts" name="UserAvatar" setup>
<script lang="ts" setup>
import { propTypes } from '@/utils/propTypes'
import { uploadAvatarApi } from '@/api/system/user/profile'
defineOptions({ name: 'UserAvatar' })
defineProps({
img: propTypes.string.def('')
})

View File

@ -21,11 +21,13 @@
</el-table-column>
</el-table>
</template>
<script lang="ts" name="UserSocial" setup>
<script lang="ts" setup>
import { SystemUserSocialTypeEnum } from '@/utils/constants'
import { getUserProfileApi, ProfileVO } from '@/api/system/user/profile'
import { socialAuthRedirect, socialUnbind } from '@/api/system/user/socialUser'
defineOptions({ name: 'UserSocial' })
const message = useMessage()
const socialUsers = ref<any[]>([])
const userInfo = ref<ProfileVO>()