style: lint fix
This commit is contained in:
parent
6d863e1a63
commit
ebffe52c7c
@ -33,7 +33,10 @@ export default [
|
|||||||
defaultClass: 'inline-block',
|
defaultClass: 'inline-block',
|
||||||
}),
|
}),
|
||||||
Components({
|
Components({
|
||||||
resolvers: [NaiveUiResolver(), IconsResolver({ customCollections: ['custom'], componentPrefix: 'icon' })],
|
resolvers: [
|
||||||
|
NaiveUiResolver(),
|
||||||
|
IconsResolver({ customCollections: ['custom'], componentPrefix: 'icon' }),
|
||||||
|
],
|
||||||
dts: false,
|
dts: false,
|
||||||
}),
|
}),
|
||||||
createSvgIconsPlugin({
|
createSvgIconsPlugin({
|
||||||
|
@ -38,7 +38,8 @@ const posts = [
|
|||||||
author: '大脸怪',
|
author: '大脸怪',
|
||||||
category: 'Http',
|
category: 'Http',
|
||||||
description: '谈谈前端缓存的理解',
|
description: '谈谈前端缓存的理解',
|
||||||
content: '> 背景\n\n公司有个vue-cli3移动端web项目发版更新后发现部分用户手机在钉钉内置浏览器打开出现了缓存',
|
content:
|
||||||
|
'> 背景\n\n公司有个vue-cli3移动端web项目发版更新后发现部分用户手机在钉钉内置浏览器打开出现了缓存',
|
||||||
isRecommend: true,
|
isRecommend: true,
|
||||||
isPublish: true,
|
isPublish: true,
|
||||||
createDate: '2021-06-10T18:51:19.000Z',
|
createDate: '2021-06-10T18:51:19.000Z',
|
||||||
@ -49,7 +50,8 @@ const posts = [
|
|||||||
author: '大脸怪',
|
author: '大脸怪',
|
||||||
category: 'JavaScript',
|
category: 'JavaScript',
|
||||||
description: '简单介绍下在 Promise 类中,有5 种静态方法及它们的使用场景',
|
description: '简单介绍下在 Promise 类中,有5 种静态方法及它们的使用场景',
|
||||||
content: '## 1. Promise.all\n\n并行执行多个 promise,并等待所有 promise 都准备就绪。再对它们进行处理。',
|
content:
|
||||||
|
'## 1. Promise.all\n\n并行执行多个 promise,并等待所有 promise 都准备就绪。再对它们进行处理。',
|
||||||
isRecommend: true,
|
isRecommend: true,
|
||||||
isPublish: true,
|
isPublish: true,
|
||||||
createDate: '2021-02-22T22:37:06.000Z',
|
createDate: '2021-02-22T22:37:06.000Z',
|
||||||
@ -65,7 +67,9 @@ export default [
|
|||||||
const { title, pageNo, pageSize } = data.query
|
const { title, pageNo, pageSize } = data.query
|
||||||
let pageData = []
|
let pageData = []
|
||||||
let total = 60
|
let total = 60
|
||||||
const filterData = posts.filter((item) => item.title.includes(title) || (!title && title !== 0))
|
const filterData = posts.filter(
|
||||||
|
(item) => item.title.includes(title) || (!title && title !== 0)
|
||||||
|
)
|
||||||
if (filterData.length) {
|
if (filterData.length) {
|
||||||
if (pageSize) {
|
if (pageSize) {
|
||||||
while (pageData.length < pageSize) {
|
while (pageData.length < pageSize) {
|
||||||
|
@ -2,10 +2,20 @@
|
|||||||
<footer text-14 f-c-c flex-col color="#6a6a6a">
|
<footer text-14 f-c-c flex-col color="#6a6a6a">
|
||||||
<p>
|
<p>
|
||||||
Copyright©2022
|
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>
|
||||||
<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
|
赣ICP备2020015008号-1
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
@ -21,7 +21,15 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { defineComponent, h } from 'vue'
|
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 { useCssVar } from '@vueuse/core'
|
||||||
import { kebabCase } from 'lodash-es'
|
import { kebabCase } from 'lodash-es'
|
||||||
import { setupMessage, setupDialog } from '@/utils'
|
import { setupMessage, setupDialog } from '@/utils'
|
||||||
|
@ -1,5 +1,16 @@
|
|||||||
<template>
|
<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]">
|
<n-space wrap :size="[35, 15]">
|
||||||
<slot />
|
<slot />
|
||||||
</n-space>
|
</n-space>
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div flex items-center>
|
<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 }}
|
||||||
</label>
|
</label>
|
||||||
<div :style="{ width: contentWidth + 'px' }" flex-shrink-0>
|
<div :style="{ width: contentWidth + 'px' }" flex-shrink-0>
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
<template>
|
<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 />
|
<slot />
|
||||||
<template v-if="showFooter" #footer>
|
<template v-if="showFooter" #footer>
|
||||||
<footer flex justify-end>
|
<footer flex justify-end>
|
||||||
|
@ -89,7 +89,11 @@ async function handleQuery() {
|
|||||||
if (props.isPagination && props.remote) {
|
if (props.isPagination && props.remote) {
|
||||||
paginationParams = { pageNo: pagination.page, pageSize: pagination.pageSize }
|
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
|
tableData.value = data?.pageData || data
|
||||||
pagination.itemCount = data.total ?? data.length
|
pagination.itemCount = data.total ?? data.length
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<router-view v-slot="{ Component, route }">
|
<router-view v-slot="{ Component, route }">
|
||||||
<KeepAlive :include="keepAliveRouteNames">
|
<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>
|
</KeepAlive>
|
||||||
</router-view>
|
</router-view>
|
||||||
</template>
|
</template>
|
||||||
|
@ -53,7 +53,9 @@ function getMenuItem(route, basePath = '') {
|
|||||||
order: route.meta?.order || 0,
|
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
|
if (!visibleChildren.length) return menuItem
|
||||||
|
|
||||||
@ -67,12 +69,16 @@ function getMenuItem(route, basePath = '') {
|
|||||||
path: resolvePath(menuItem.path, singleRoute.path),
|
path: resolvePath(menuItem.path, singleRoute.path),
|
||||||
icon: getIcon(singleRoute.meta),
|
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) {
|
if (visibleItems.length === 1) {
|
||||||
menuItem = getMenuItem(visibleItems[0], menuItem.path)
|
menuItem = getMenuItem(visibleItems[0], menuItem.path)
|
||||||
} else if (visibleItems.length > 1) {
|
} 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 {
|
} else {
|
||||||
menuItem.children = visibleChildren
|
menuItem.children = visibleChildren
|
||||||
|
@ -67,7 +67,9 @@ const options = computed(() => [
|
|||||||
{
|
{
|
||||||
label: '关闭右侧',
|
label: '关闭右侧',
|
||||||
key: 'close-right',
|
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' }),
|
icon: renderIcon('mdi:arrow-expand-right', { size: '14px' }),
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
@ -26,7 +26,8 @@ export const useTagsStore = defineStore('tag', {
|
|||||||
},
|
},
|
||||||
addTag(tag = {}) {
|
addTag(tag = {}) {
|
||||||
this.setActiveTag(tag.path)
|
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])
|
this.setTags([...this.tags, tag])
|
||||||
},
|
},
|
||||||
removeTag(path) {
|
removeTag(path) {
|
||||||
|
@ -2,7 +2,8 @@ import { router } from '@/router'
|
|||||||
|
|
||||||
export function toLogin() {
|
export function toLogin() {
|
||||||
const currentRoute = unref(router.currentRoute)
|
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({
|
router.replace({
|
||||||
path: '/login',
|
path: '/login',
|
||||||
query: needRedirect ? { ...currentRoute.query, redirect: currentRoute.path } : {},
|
query: needRedirect ? { ...currentRoute.query, redirect: currentRoute.path } : {},
|
||||||
|
@ -15,14 +15,18 @@
|
|||||||
|
|
||||||
<n-card title="带 Icon 的按钮">
|
<n-card title="带 Icon 的按钮">
|
||||||
<n-space>
|
<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">
|
<n-button type="error">
|
||||||
<TheIcon icon="material-symbols:delete-outline" :size="18" class="mr-5" /> 删除
|
<TheIcon icon="material-symbols:delete-outline" :size="18" class="mr-5" /> 删除
|
||||||
</n-button>
|
</n-button>
|
||||||
<n-button type="warning">
|
<n-button type="warning">
|
||||||
<TheIcon icon="material-symbols:edit-outline" :size="18" class="mr-5" /> 编辑
|
<TheIcon icon="material-symbols:edit-outline" :size="18" class="mr-5" /> 编辑
|
||||||
</n-button>
|
</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-space>
|
||||||
</n-card>
|
</n-card>
|
||||||
</n-space>
|
</n-space>
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<CommonPage show-footer>
|
<CommonPage show-footer>
|
||||||
<p>
|
<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>
|
||||||
<p>
|
<p>
|
||||||
playground:
|
playground:
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<AppPage>
|
<AppPage>
|
||||||
<div h-full flex-col border-1 bc-ccc dark:bg-dark>
|
<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
|
<WangEditor
|
||||||
v-model="valueHtml"
|
v-model="valueHtml"
|
||||||
style="flex: 1; overflow-y: hidden"
|
style="flex: 1; overflow-y: hidden"
|
||||||
|
@ -181,7 +181,10 @@ const columns = [
|
|||||||
style: 'margin-left: 15px;',
|
style: 'margin-left: 15px;',
|
||||||
onClick: () => handleDelete(row.id),
|
onClick: () => handleDelete(row.id),
|
||||||
},
|
},
|
||||||
{ default: () => '删除', icon: renderIcon('material-symbols:delete-outline', { size: 14 }) }
|
{
|
||||||
|
default: () => '删除',
|
||||||
|
icon: renderIcon('material-symbols:delete-outline', { size: 14 }),
|
||||||
|
}
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -24,8 +24,15 @@
|
|||||||
</div>
|
</div>
|
||||||
<n-space class="mt-16" justify="space-evenly">
|
<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.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(`![${item.fileName}](${item.url})`)"
|
||||||
<n-button dashed type="primary" @click="copy(`<img src="${item.url}" />`)">img</n-button>
|
>MD</n-button
|
||||||
|
>
|
||||||
|
<n-button
|
||||||
|
dashed
|
||||||
|
type="primary"
|
||||||
|
@click="copy(`<img src="${item.url}" />`)"
|
||||||
|
>img</n-button
|
||||||
|
>
|
||||||
</n-space>
|
</n-space>
|
||||||
</n-card>
|
</n-card>
|
||||||
<div v-for="i in 4" :key="i" class="w-280" />
|
<div v-for="i in 4" :key="i" class="w-280" />
|
||||||
|
@ -10,7 +10,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div w-320 flex-col px-20 py-35>
|
<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>
|
<div mt-30>
|
||||||
<n-input
|
<n-input
|
||||||
v-model:value="loginInfo.name"
|
v-model:value="loginInfo.name"
|
||||||
@ -33,11 +35,23 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div mt-20>
|
<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>
|
||||||
|
|
||||||
<div mt-20>
|
<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>
|
</n-button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,7 +1,18 @@
|
|||||||
import { defineConfig, presetAttributify, presetUno } from 'unocss'
|
import { defineConfig, presetAttributify, presetUno } from 'unocss'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
exclude: ['node_modules', '.git', '.github', '.husky', '.vscode', 'build', 'dist', 'mock', 'public', './stats.html'],
|
exclude: [
|
||||||
|
'node_modules',
|
||||||
|
'.git',
|
||||||
|
'.github',
|
||||||
|
'.husky',
|
||||||
|
'.vscode',
|
||||||
|
'build',
|
||||||
|
'dist',
|
||||||
|
'mock',
|
||||||
|
'public',
|
||||||
|
'./stats.html',
|
||||||
|
],
|
||||||
presets: [presetUno(), presetAttributify()],
|
presets: [presetUno(), presetAttributify()],
|
||||||
shortcuts: [
|
shortcuts: [
|
||||||
['wh-full', 'w-full h-full'],
|
['wh-full', 'w-full h-full'],
|
||||||
@ -16,7 +27,10 @@ export default defineConfig({
|
|||||||
],
|
],
|
||||||
rules: [
|
rules: [
|
||||||
[/^bc-(.+)$/, ([, color]) => ({ 'border-color': `#${color}` })],
|
[/^bc-(.+)$/, ([, color]) => ({ 'border-color': `#${color}` })],
|
||||||
['card-shadow', { 'box-shadow': '0 1px 2px -2px #00000029, 0 3px 6px #0000001f, 0 5px 12px 4px #00000017' }],
|
[
|
||||||
|
'card-shadow',
|
||||||
|
{ 'box-shadow': '0 1px 2px -2px #00000029, 0 3px 6px #0000001f, 0 5px 12px 4px #00000017' },
|
||||||
|
],
|
||||||
],
|
],
|
||||||
theme: {
|
theme: {
|
||||||
colors: {
|
colors: {
|
||||||
|
Loading…
Reference in New Issue
Block a user