style: lint fix

This commit is contained in:
zclzone
2023-05-07 22:05:13 +08:00
parent 6d863e1a63
commit ebffe52c7c
20 changed files with 146 additions and 30 deletions

View File

@@ -2,10 +2,20 @@
<footer text-14 f-c-c flex-col color="#6a6a6a">
<p>
Copyright©2022
<a href="https://github.com/zclzone" target="__blank" hover="decoration-underline color-primary"> 大脸怪</a>
<a
href="https://github.com/zclzone"
target="__blank"
hover="decoration-underline color-primary"
>
大脸怪</a
>
</p>
<p>
<a href="http://beian.miit.gov.cn/" target="__blank" hover="decoration-underline color-primary">
<a
href="http://beian.miit.gov.cn/"
target="__blank"
hover="decoration-underline color-primary"
>
赣ICP备2020015008号-1
</a>
</p>

View File

@@ -21,7 +21,15 @@
<script setup>
import { defineComponent, h } from 'vue'
import { zhCN, dateZhCN, darkTheme, useLoadingBar, useDialog, useMessage, useNotification } from 'naive-ui'
import {
zhCN,
dateZhCN,
darkTheme,
useLoadingBar,
useDialog,
useMessage,
useNotification,
} from 'naive-ui'
import { useCssVar } from '@vueuse/core'
import { kebabCase } from 'lodash-es'
import { setupMessage, setupDialog } from '@/utils'

View File

@@ -1,5 +1,16 @@
<template>
<div min-h-60 p-15 flex items-start justify-between b-1 bc-ccc rounded-8 bg="#fafafc" dark:bg-black>
<div
min-h-60
p-15
flex
items-start
justify-between
b-1
bc-ccc
rounded-8
bg="#fafafc"
dark:bg-black
>
<n-space wrap :size="[35, 15]">
<slot />
</n-space>

View File

@@ -1,6 +1,11 @@
<template>
<div flex items-center>
<label v-if="!isNullOrWhitespace(label)" w-80 flex-shrink-0 :style="{ width: labelWidth + 'px' }">
<label
v-if="!isNullOrWhitespace(label)"
w-80
flex-shrink-0
:style="{ width: labelWidth + 'px' }"
>
{{ label }}
</label>
<div :style="{ width: contentWidth + 'px' }" flex-shrink-0>

View File

@@ -1,5 +1,12 @@
<template>
<n-modal v-model:show="show" :style="{ width }" preset="card" :title="title" size="huge" :bordered="false">
<n-modal
v-model:show="show"
:style="{ width }"
preset="card"
:title="title"
size="huge"
:bordered="false"
>
<slot />
<template v-if="showFooter" #footer>
<footer flex justify-end>

View File

@@ -89,7 +89,11 @@ async function handleQuery() {
if (props.isPagination && props.remote) {
paginationParams = { pageNo: pagination.page, pageSize: pagination.pageSize }
}
const { data } = await props.getData({ ...props.queryItems, ...props.extraParams, ...paginationParams })
const { data } = await props.getData({
...props.queryItems,
...props.extraParams,
...paginationParams,
})
tableData.value = data?.pageData || data
pagination.itemCount = data.total ?? data.length
} catch (error) {

View File

@@ -1,7 +1,11 @@
<template>
<router-view v-slot="{ Component, route }">
<KeepAlive :include="keepAliveRouteNames">
<component :is="Component" v-if="appStore.reloadFlag" :key="appStore.aliveKeys[route.name] || route.fullPath" />
<component
:is="Component"
v-if="appStore.reloadFlag"
:key="appStore.aliveKeys[route.name] || route.fullPath"
/>
</KeepAlive>
</router-view>
</template>

View File

@@ -53,7 +53,9 @@ function getMenuItem(route, basePath = '') {
order: route.meta?.order || 0,
}
const visibleChildren = route.children ? route.children.filter((item) => item.name && !item.isHidden) : []
const visibleChildren = route.children
? route.children.filter((item) => item.name && !item.isHidden)
: []
if (!visibleChildren.length) return menuItem
@@ -67,12 +69,16 @@ function getMenuItem(route, basePath = '') {
path: resolvePath(menuItem.path, singleRoute.path),
icon: getIcon(singleRoute.meta),
}
const visibleItems = singleRoute.children ? singleRoute.children.filter((item) => item.name && !item.isHidden) : []
const visibleItems = singleRoute.children
? singleRoute.children.filter((item) => item.name && !item.isHidden)
: []
if (visibleItems.length === 1) {
menuItem = getMenuItem(visibleItems[0], menuItem.path)
} else if (visibleItems.length > 1) {
menuItem.children = visibleItems.map((item) => getMenuItem(item, menuItem.path)).sort((a, b) => a.order - b.order)
menuItem.children = visibleItems
.map((item) => getMenuItem(item, menuItem.path))
.sort((a, b) => a.order - b.order)
}
} else {
menuItem.children = visibleChildren

View File

@@ -67,7 +67,9 @@ const options = computed(() => [
{
label: '关闭右侧',
key: 'close-right',
disabled: tagsStore.tags.length <= 1 || props.currentPath === tagsStore.tags[tagsStore.tags.length - 1].path,
disabled:
tagsStore.tags.length <= 1 ||
props.currentPath === tagsStore.tags[tagsStore.tags.length - 1].path,
icon: renderIcon('mdi:arrow-expand-right', { size: '14px' }),
},
])

View File

@@ -26,7 +26,8 @@ export const useTagsStore = defineStore('tag', {
},
addTag(tag = {}) {
this.setActiveTag(tag.path)
if (WITHOUT_TAG_PATHS.includes(tag.path) || this.tags.some((item) => item.path === tag.path)) return
if (WITHOUT_TAG_PATHS.includes(tag.path) || this.tags.some((item) => item.path === tag.path))
return
this.setTags([...this.tags, tag])
},
removeTag(path) {

View File

@@ -2,7 +2,8 @@ import { router } from '@/router'
export function toLogin() {
const currentRoute = unref(router.currentRoute)
const needRedirect = !currentRoute.meta.requireAuth && !['/404', '/login'].includes(router.currentRoute.value.path)
const needRedirect =
!currentRoute.meta.requireAuth && !['/404', '/login'].includes(router.currentRoute.value.path)
router.replace({
path: '/login',
query: needRedirect ? { ...currentRoute.query, redirect: currentRoute.path } : {},

View File

@@ -15,14 +15,18 @@
<n-card title="带 Icon 的按钮">
<n-space>
<n-button type="info"> <TheIcon icon="material-symbols:add" :size="18" class="mr-5" /> 新增 </n-button>
<n-button type="info">
<TheIcon icon="material-symbols:add" :size="18" class="mr-5" /> 新增
</n-button>
<n-button type="error">
<TheIcon icon="material-symbols:delete-outline" :size="18" class="mr-5" /> 删除
</n-button>
<n-button type="warning">
<TheIcon icon="material-symbols:edit-outline" :size="18" class="mr-5" /> 编辑
</n-button>
<n-button type="primary"> <TheIcon icon="majesticons:eye-line" :size="18" class="mr-5" /> 查看 </n-button>
<n-button type="primary">
<TheIcon icon="majesticons:eye-line" :size="18" class="mr-5" /> 查看
</n-button>
</n-space>
</n-card>
</n-space>

View File

@@ -1,7 +1,9 @@
<template>
<CommonPage show-footer>
<p>
文档<a hover-decoration-underline c-blue href="https://uno.antfu.me/" target="_blank">https://uno.antfu.me/</a>
文档<a hover-decoration-underline c-blue href="https://uno.antfu.me/" target="_blank"
>https://uno.antfu.me/</a
>
</p>
<p>
playground

View File

@@ -1,7 +1,13 @@
<template>
<AppPage>
<div h-full flex-col border-1 bc-ccc dark:bg-dark>
<WangToolbar border-b bc-ccc :editor="editorRef" :default-config="toolbarConfig" mode="default" />
<WangToolbar
border-b
bc-ccc
:editor="editorRef"
:default-config="toolbarConfig"
mode="default"
/>
<WangEditor
v-model="valueHtml"
style="flex: 1; overflow-y: hidden"

View File

@@ -181,7 +181,10 @@ const columns = [
style: 'margin-left: 15px;',
onClick: () => handleDelete(row.id),
},
{ default: () => '删除', icon: renderIcon('material-symbols:delete-outline', { size: 14 }) }
{
default: () => '删除',
icon: renderIcon('material-symbols:delete-outline', { size: 14 }),
}
),
]
},

View File

@@ -24,8 +24,15 @@
</div>
<n-space class="mt-16" justify="space-evenly">
<n-button dashed type="primary" @click="copy(item.url)"> url </n-button>
<n-button dashed type="primary" @click="copy(`![${item.fileName}](${item.url})`)">MD</n-button>
<n-button dashed type="primary" @click="copy(`&lt;img src=&quot;${item.url}&quot; /&gt;`)">img</n-button>
<n-button dashed type="primary" @click="copy(`![${item.fileName}](${item.url})`)"
>MD</n-button
>
<n-button
dashed
type="primary"
@click="copy(`&lt;img src=&quot;${item.url}&quot; /&gt;`)"
>img</n-button
>
</n-space>
</n-card>
<div v-for="i in 4" :key="i" class="w-280" />

View File

@@ -10,7 +10,9 @@
</div>
<div w-320 flex-col px-20 py-35>
<h5 f-c-c text-24 font-normal color="#6a6a6a"><icon-custom-logo mr-10 text-50 color-primary />{{ title }}</h5>
<h5 f-c-c text-24 font-normal color="#6a6a6a">
<icon-custom-logo mr-10 text-50 color-primary />{{ title }}
</h5>
<div mt-30>
<n-input
v-model:value="loginInfo.name"
@@ -33,11 +35,23 @@
</div>
<div mt-20>
<n-checkbox :checked="isRemember" label="记住我" :on-update:checked="(val) => (isRemember = val)" />
<n-checkbox
:checked="isRemember"
label="记住我"
:on-update:checked="(val) => (isRemember = val)"
/>
</div>
<div mt-20>
<n-button w-full h-50 rounded-5 text-16 type="primary" :loading="loading" @click="handleLogin">
<n-button
w-full
h-50
rounded-5
text-16
type="primary"
:loading="loading"
@click="handleLogin"
>
登录
</n-button>
</div>