fix: lint code in type check

This commit is contained in:
AkagiYui 2024-03-16 22:50:45 +08:00
parent f867721fb8
commit 58c01069f9
8 changed files with 18 additions and 28 deletions

View File

@ -7,9 +7,9 @@ withDefaults(
)
const emit = defineEmits<{
positiveClick?: []
negativeClick?: []
"update:show"?: [value: boolean]
(e: "positiveClick"): void
(e: "negativeClick"): void
(e: "update:show", value: boolean): void
}>()
const onNegativeClick = () => {

View File

@ -3,7 +3,7 @@ export function unmarshalDate(date: string | Date) {
return date
}
const parts = date.split(/[-T:.+]/)
const parts: number[] = date.split(/[-T:.+]/).map((part) => parseInt(part, 10))
// 注意JavaScript中的月份从0开始所以需要将月份减1
return new Date(
parts[0],

View File

@ -342,7 +342,6 @@ const rules = {
<NSpace justify="end" style="width: 100%">
<NButton
:type="true ? 'success' : 'warning'"
@click="true ? addData() : updateData()"
>
{{ true ? "确定" : "修改" }}
</NButton>
@ -382,7 +381,6 @@ const rules = {
tertiary
type="primary"
:disabled="true"
@click="ppp = true"
>
<template #icon>
<n-icon>

View File

@ -62,7 +62,7 @@ const tableColumns = [
title: "配额",
key: "capacity",
minWidth: "200px",
render(row: User) {
render() {
return h(
NTooltip,
{
@ -287,10 +287,7 @@ const rules = {
</NSpace>
<template #action>
<NSpace justify="end" style="width: 100%">
<NButton
:type="true ? 'success' : 'warning'"
@click="true ? addData() : updateData()"
>
<NButton :type="true ? 'success' : 'warning'">
{{ true ? "确定" : "修改" }}
</NButton>
</NSpace>
@ -325,7 +322,7 @@ const rules = {
</template>
刷新
</n-button>
<n-button tertiary type="primary" @click="ppp = true">
<n-button tertiary type="primary">
<template #icon>
<n-icon>
<AddOutline />

View File

@ -81,7 +81,7 @@ const tableColumns = [
title: "配额",
key: "capacity",
minWidth: "200px",
render(row: User) {
render() {
return h(
NTooltip,
{
@ -372,7 +372,7 @@ const afterResetPasswordModalLeave = () => {
<NModal
:show="showResetPasswordModal"
preset="card"
closable="true"
closable:="true"
:title="`重置密码 (${selectRow?.username})`"
bordered
:mask-closable="false"

View File

@ -15,15 +15,6 @@ const personalInfo = ref({
nickname: "",
email: "",
})
const rules = {
nickname: {
required: false,
message: "请输入昵称",
min: 3,
trigger: ["input", "blur"],
type: "email",
},
}
onBeforeMount(() => {
personalInfo.value.nickname = nickname.value
@ -44,7 +35,7 @@ const uploadAvatar = (fileList: UploadFileInfo[]) => {
return
}
uploadUserAvatar(file)
.then((res) => {
.then(() => {
window.$message.success("头像上传成功")
renewAvatar()
})

View File

@ -1,11 +1,16 @@
{
"extends": "@vue/tsconfig/tsconfig.dom.json",
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
"include": [
"env.d.ts",
"src/**/*",
"src/**/*.vue",
"auto-imports.d.ts",
"components.d.ts"
],
"exclude": ["src/**/__tests__/*"],
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]

View File

@ -10,7 +10,6 @@
"compilerOptions": {
"composite": true,
"noEmit": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"module": "ESNext",
"moduleResolution": "Bundler",