fix: fix eslint format

This commit is contained in:
Coffee-crocodile 2023-05-24 14:23:55 +08:00
parent ebb863078c
commit 639a75adfa
4 changed files with 54 additions and 72 deletions

View File

@ -5,6 +5,5 @@
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.validate": ["typescript", "javascript", "vue", "html"],
"eslint.options": { "configFile": ".eslintrc.js" }
"eslint.validate": ["typescript", "javascript", "vue", "html"]
}

View File

@ -3,13 +3,37 @@
"version": "0.0.1",
"private": true,
"description": "",
"author": "iam-see <chen.dev@foxmail.com> (https://github.com/chansee97/)",
"author": {
"name": "chansee97",
"email": "chen.dev@foxmail.com",
"url": "https://github.com/chansee97"
},
"license": "MIT",
"homepage": "https://github.com/chansee97/Ench-admin",
"repository": {
"url": "https://github.com/chansee97/Ench-admin.git"
},
"bugs": {
"url": "https://github.com/chansee97/Ench-admin/issues"
},
"keywords": [
"Vue",
"Vue3",
"admin"
"admin",
"admin-template",
"vue-admin",
"vue-admin-template",
"Vite4",
"Vite",
"vite-admin",
"TypeScript",
"TS",
"NaiveUI",
"naive-ui",
"naive-admin",
"NaiveUI-Admin",
"naive-ui-admin",
"UnoCSS"
],
"scripts": {
"dev": "vite",
@ -82,8 +106,10 @@
"commit-msg": "pnpm commitlint -e"
},
"lint-staged": {
"*.{js,jsx,,mjs,ts,tsx,json,,md,yml}": [
"*.{js,jsx,mjs,ts,tsx,json,md,yml}": [
"eslint --fix"
]
],
"*.vue": [
"eslint --fix" ]
}
}

View File

@ -1,25 +1,20 @@
<script setup lang="ts">
import type { GlobalThemeOverrides } from 'naive-ui'
import { dateZhCN, useOsTheme, zhCN } from 'naive-ui'
import { useAppStore } from './store'
// import themeConfig from './theme.json';
import type { GlobalThemeOverrides } from 'naive-ui'
import { dateZhCN, useOsTheme, zhCN } from 'naive-ui'
import { useAppStore } from './store'
import themeConfig from './theme.json';
const locale = zhCN
const dateLocale = dateZhCN
const appStore = useAppStore()
const locale = zhCN
const dateLocale = dateZhCN
const appStore = useAppStore()
const osThemeRef = useOsTheme()
appStore.setDarkMode(osThemeRef.value === 'dark')
const osThemeRef = useOsTheme()
appStore.setDarkMode(osThemeRef.value === 'dark')
const themeOverrides: GlobalThemeOverrides = {}
const themeOverrides: GlobalThemeOverrides = {} || themeConfig
</script>
<template>
<n-config-provider
class="wh-full"
:theme="appStore.darkTheme"
:locale="locale"
:date-locale="dateLocale"
<n-config-provider class="wh-full" :theme="appStore.darkTheme" :locale="locale" :date-locale="dateLocale"
:theme-overrides="themeOverrides">
<naive-provider><router-view /></naive-provider>
</n-config-provider>

View File

@ -1,6 +1,7 @@
<script setup lang="ts">
import { ref } from 'vue'
import { useAuthStore } from '@/store'
const authStore = useAuthStore()
const { userInfo } = authStore
@ -42,24 +43,13 @@ function handleValidateClick() {
</script>
<template>
<n-grid
:y-gap="16"
:cols="1"
>
<n-grid :y-gap="16" :cols="1">
<n-gi>
<n-card title="个人信息">
<n-space size="large">
<n-avatar
round
:size="128"
:src="userInfo?.avatar"
/>
<n-avatar round :size="128" :src="userInfo?.avatar" />
<n-descriptions
label-placement="left"
:column="2"
:title="`傍晚好,${userInfo?.userName},这里是简单的个人中心模板`"
>
<n-descriptions label-placement="left" :column="2" :title="`傍晚好,${userInfo?.userName},这里是简单的个人中心模板`">
<n-descriptions-item label="id">
{{ userInfo?.userId }}
</n-descriptions-item>
@ -80,46 +70,18 @@ function handleValidateClick() {
<n-gi>
<n-card title="信息修改">
<n-space justify="center">
<n-form
ref="formRef"
class="w-500px"
:label-width="80"
:model="formValue"
:rules="rules"
>
<n-form-item
label="姓名"
path="user.name"
>
<n-input
v-model:value="formValue.user.name"
placeholder="输入姓名"
/>
<n-form ref="formRef" class="w-500px" :label-width="80" :model="formValue" :rules="rules">
<n-form-item label="姓名" path="user.name">
<n-input v-model:value="formValue.user.name" placeholder="输入姓名" />
</n-form-item>
<n-form-item
label="年龄"
path="user.age"
>
<n-input
v-model:value="formValue.user.age"
placeholder="输入年龄"
/>
<n-form-item label="年龄" path="user.age">
<n-input v-model:value="formValue.user.age" placeholder="输入年龄" />
</n-form-item>
<n-form-item
label="电话号码"
path="phone"
>
<n-input
v-model:value="formValue.phone"
placeholder="电话号码"
/>
<n-form-item label="电话号码" path="phone">
<n-input v-model:value="formValue.phone" placeholder="电话号码" />
</n-form-item>
<n-form-item>
<n-button
attr-type="button"
block
@click="handleValidateClick"
>
<n-button attr-type="button" block @click="handleValidateClick">
验证
</n-button>
</n-form-item>