From e39ed353e3cba934d65e2b5508ed321fccae48cb Mon Sep 17 00:00:00 2001
From: Tyh2001 <1469442737@qq.com>
Date: Fri, 25 Aug 2023 22:34:50 +0800
Subject: [PATCH] =?UTF-8?q?style:=20=E5=85=A8=E5=B1=80=E6=A0=BC=E5=BC=8F?=
=?UTF-8?q?=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/docs.yml | 2 +-
docs/.vitepress/config/head.ts | 3 +-
docs/.vitepress/json/search.json | 2 +-
docs/components/demos/avatar/demo1.vue | 10 ++++--
docs/components/image.md | 17 ++++++++--
docs/components/watermark.md | 4 ++-
.../_hooks/use-calendar/index.ts | 20 ++++++------
.../_hooks/use-collapse-animation/index.ts | 32 +++++++++----------
.../_hooks/use-confirm-box/index.ts | 15 ++++-----
.../fighting-design/_hooks/use-lunar/index.ts | 1 -
.../fighting-design/_utils/props/index.ts | 6 ++--
.../fighting-design/confirm-box/src/props.ts | 7 +++-
.../expand-card/__test__/expand-card.spec.ts | 10 ++++--
packages/fighting-design/package.json | 2 +-
.../tree/components/tree-item/interface.ts | 2 +-
.../fighting-design/tree/src/interface.ts | 11 +++++--
packages/fighting-design/tree/src/props.ts | 9 ++++--
17 files changed, 96 insertions(+), 57 deletions(-)
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 8f0de79640..d1b785c90e 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -52,4 +52,4 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/.vitepress/dist
- publish_branch: gh-pages # 将部署到 gh-pages 分支
+ publish_branch: gh-pages # 将部署到 gh-pages 分支
diff --git a/docs/.vitepress/config/head.ts b/docs/.vitepress/config/head.ts
index 7e74a2459f..8ffc07ce47 100644
--- a/docs/.vitepress/config/head.ts
+++ b/docs/.vitepress/config/head.ts
@@ -60,7 +60,8 @@ export const head: HeadConfig[] = [
'meta',
{
property: 'og:image',
- content: 'https://raw.githubusercontent.com/Tyh2001/images/4ad62a8f00aa2473deca61598f307430d8d4a4cf/fighting-design/FightingDesign.svg'
+ content:
+ 'https://raw.githubusercontent.com/Tyh2001/images/4ad62a8f00aa2473deca61598f307430d8d4a4cf/fighting-design/FightingDesign.svg'
}
],
/** OG 描述 */
diff --git a/docs/.vitepress/json/search.json b/docs/.vitepress/json/search.json
index 75647568d3..6802e2f15b 100644
--- a/docs/.vitepress/json/search.json
+++ b/docs/.vitepress/json/search.json
@@ -361,4 +361,4 @@
"url": "components/confirm-box"
}
]
-}
\ No newline at end of file
+}
diff --git a/docs/components/demos/avatar/demo1.vue b/docs/components/demos/avatar/demo1.vue
index d73d833976..470fb5c848 100644
--- a/docs/components/demos/avatar/demo1.vue
+++ b/docs/components/demos/avatar/demo1.vue
@@ -6,7 +6,10 @@
contain
-
+
cover
@@ -18,7 +21,10 @@
scale-down
-
+
diff --git a/docs/components/image.md b/docs/components/image.md
index 2ed5b1ee8e..f4c3418eeb 100644
--- a/docs/components/image.md
+++ b/docs/components/image.md
@@ -16,7 +16,10 @@
```html
-
+
```
:::
@@ -99,7 +102,11 @@
```html
-
+
```
:::
@@ -115,7 +122,11 @@
```html
-
+
```
:::
diff --git a/docs/components/watermark.md b/docs/components/watermark.md
index 2cd0900b17..9bfba34cfa 100644
--- a/docs/components/watermark.md
+++ b/docs/components/watermark.md
@@ -110,7 +110,9 @@
```html
-
+
这是一个重要的文件
diff --git a/packages/fighting-design/_hooks/use-calendar/index.ts b/packages/fighting-design/_hooks/use-calendar/index.ts
index 5f17d01cfc..8b164cccb8 100644
--- a/packages/fighting-design/_hooks/use-calendar/index.ts
+++ b/packages/fighting-design/_hooks/use-calendar/index.ts
@@ -34,10 +34,10 @@ export const useCalendar = (prop: CalendarProps): UseCalendarReturn => {
/**
* 获取指定月份的天数
- *
+ *
* @param { number } year 年份
* @param { number } month 月份
- * @returns
+ * @returns
*/
const getDaysInMonth = (year: number, month: number): number => {
const daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
@@ -56,10 +56,10 @@ export const useCalendar = (prop: CalendarProps): UseCalendarReturn => {
/**
* 获取指定年份指定月份的 1号是星期几
- *
+ *
* @param { number } year 年份
* @param { number } month 月份
- * @returns
+ * @returns
*/
const getFirstDayOfWeek = (year: number, month: number): number => {
/**
@@ -67,7 +67,7 @@ export const useCalendar = (prop: CalendarProps): UseCalendarReturn => {
*
* 月份要减 1,因为月份是从 0 开始计数的
*/
- const firstDay = new Date(year, month - 1, 1) //
+ const firstDay = new Date(year, month - 1, 1) //
/** 获取当前月份1号是星期几,0 表示星期日,1 表示星期一,以此类推 */
const dayOfWeek = firstDay.getDay()
@@ -77,20 +77,20 @@ export const useCalendar = (prop: CalendarProps): UseCalendarReturn => {
/**
* 判断是否为闰年
- *
+ *
* @param { number } year 年份
- * @returns
+ * @returns
*/
const isLeapYear = (year: number): boolean => {
- return (year % 4 === 0 && year % 100 !== 0) || (year % 400 === 0)
+ return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0
}
/**
* 生成日历数组
- *
+ *
* @param { number } year 年份
* @param { number } month 月份
- * @returns
+ * @returns
*/
const generateCalendar = (year: number, month: number): GenerateCalendarItem[] => {
/** 日历详情 */
diff --git a/packages/fighting-design/_hooks/use-collapse-animation/index.ts b/packages/fighting-design/_hooks/use-collapse-animation/index.ts
index 42f9952674..af2eaac8f9 100644
--- a/packages/fighting-design/_hooks/use-collapse-animation/index.ts
+++ b/packages/fighting-design/_hooks/use-collapse-animation/index.ts
@@ -5,8 +5,8 @@ import type { CollapseAnimationProps } from '../../collapse-animation'
/**
* useCollapseAnimation 返回值类型接口
- *
- * @param { Function } onBeforeEnter 在开启动画之前
+ *
+ * @param { Function } onBeforeEnter 在开启动画之前
* @param { Function } onEnter 开启过渡前插入 DOM
* @param { Function } onAfterEnter 开启过渡完成
* @param { Function } onBeforeLeave 关闭动画之前
@@ -24,9 +24,9 @@ export interface UseCollapseAnimationReturn {
/**
* 对于 Collapse Animation 折叠动画样式处理
- *
+ *
* @param prop prop 参数
- * @returns
+ * @returns
*/
export const useCollapseAnimation = (
prop: CollapseAnimationProps
@@ -43,9 +43,9 @@ export const useCollapseAnimation = (
/**
* 在开启动画之前
- *
+ *
* 给元素设置动画样式和默认宽高
- *
+ *
* @param { Object } el 元素节点
*/
const onBeforeEnter = (el: Element): void => {
@@ -66,7 +66,7 @@ export const useCollapseAnimation = (
/**
* 开启过渡前插入 DOM
- *
+ *
* @param { Object } el 元素节点
*/
const onEnter = (el: Element): void => {
@@ -76,9 +76,9 @@ export const useCollapseAnimation = (
/**
* 将元素的高度设置为元素内容高度的度量
- *
+ *
* @see Element.scrollHeight https://developer.mozilla.org/zh-CN/docs/Web/API/Element/scrollHeight
- *
+ *
* 如果需要高度过渡动画,则将高度设置为滚动高度,否则不做动画处理,设置 auto
*/
if (prop.heightAnimation) {
@@ -87,7 +87,7 @@ export const useCollapseAnimation = (
node.style.height = 'auto'
}
- /**
+ /**
* 如果需要宽度过渡
*/
if (prop.widthAnimation) {
@@ -95,7 +95,7 @@ export const useCollapseAnimation = (
/**
* 获取到宽度
- *
+ *
* @see Element.getBoundingClientRect() https://developer.mozilla.org/zh-CN/docs/Web/API/Element/getBoundingClientRect
*/
const width: number = node.getBoundingClientRect().width
@@ -104,7 +104,7 @@ export const useCollapseAnimation = (
/**
* offsetWidth 的访问行为会触发浏览器的重排
- *
+ *
* @see HTMLElement.offsetWidth https://developer.mozilla.org/zh-CN/docs/Web/API/HTMLElement/offsetWidth
*/
node.offsetWidth
@@ -117,7 +117,7 @@ export const useCollapseAnimation = (
/**
* 开启过渡完成
- *
+ *
* @param { Object } el 元素节点
*/
const onAfterEnter = (el: Element): void => {
@@ -132,7 +132,7 @@ export const useCollapseAnimation = (
/**
* 关闭动画之前
- *
+ *
* @param { Object } el 元素节点
*/
const onBeforeLeave = (el: Element): void => {
@@ -155,7 +155,7 @@ export const useCollapseAnimation = (
/**
* 关闭动画离开之前
- *
+ *
* @param { Object } el 元素节点
*/
const onLeave = (el: Element): void => {
@@ -174,7 +174,7 @@ export const useCollapseAnimation = (
/**
* 关闭动画结束之后
- *
+ *
* @param { Object } el 元素节点
*/
const onAfterLeave = (el: Element): void => {
diff --git a/packages/fighting-design/_hooks/use-confirm-box/index.ts b/packages/fighting-design/_hooks/use-confirm-box/index.ts
index d2cbcaba02..0fef037110 100644
--- a/packages/fighting-design/_hooks/use-confirm-box/index.ts
+++ b/packages/fighting-design/_hooks/use-confirm-box/index.ts
@@ -13,18 +13,17 @@ export interface UseConfirmBoxReturn {
/**
* 确认框组件方法
- *
+ *
* @author Tyh2001
* @param { Object } component 组件实例
- * @returns
+ * @returns
*/
export const useConfirmBox = (component: Component): UseConfirmBoxReturn => {
-
/**
* 创建组件
- *
+ *
* @param { Object } options 配置参数
- * @returns
+ * @returns
*/
const create = (options: Partial): ComponentInternalInstance => {
const vNode = h(component, options)
@@ -38,9 +37,9 @@ export const useConfirmBox = (component: Component): UseConfirmBoxReturn => {
/**
* 暴露出去的方法
- *
- * @param { Object } options 配置对象
- * @returns
+ *
+ * @param { Object } options 配置对象
+ * @returns
*/
const confirmBox = (options: Partial): ComponentInternalInstance => {
return create(reactive({ ...options, show: true }))
diff --git a/packages/fighting-design/_hooks/use-lunar/index.ts b/packages/fighting-design/_hooks/use-lunar/index.ts
index 9d28e55447..2553c33978 100644
--- a/packages/fighting-design/_hooks/use-lunar/index.ts
+++ b/packages/fighting-design/_hooks/use-lunar/index.ts
@@ -170,7 +170,6 @@ export const useLunar = (): UseLunarReturn => {
mPara: number,
dPara: number
): -1 | GetLunarDetailReturn => {
-
/**
* @see parseInt https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/parseInt
*/
diff --git a/packages/fighting-design/_utils/props/index.ts b/packages/fighting-design/_utils/props/index.ts
index b72ff328d8..d9b5d195a0 100644
--- a/packages/fighting-design/_utils/props/index.ts
+++ b/packages/fighting-design/_utils/props/index.ts
@@ -4,12 +4,12 @@ import type { PropType } from 'vue'
* 设置组件的 prop 参数
*
* @see 为组件的props标注类型 https://cn.vuejs.org/guide/typescript/options-api.html#typing-component-props
- *
+ *
* 注意:你需要了解 null 和 undefined 的区别
- *
+ *
* null 表示无对象 表示 no object
* undefined 表示空值 表示 no value
- *
+ *
* 如果一个值将来可能会是一个对象,但是目前还不是,则使用 null,也就是说 Object 类型的默认值都需要使用 null
* 基本类型都使用 undefined 默认值
*/
diff --git a/packages/fighting-design/confirm-box/src/props.ts b/packages/fighting-design/confirm-box/src/props.ts
index b8d42099a2..852d2729d1 100644
--- a/packages/fighting-design/confirm-box/src/props.ts
+++ b/packages/fighting-design/confirm-box/src/props.ts
@@ -1,4 +1,9 @@
-import { setBooleanProp, setFunctionProp, setStringNumberProp, setStringProp } from '../../_utils'
+import {
+ setBooleanProp,
+ setFunctionProp,
+ setStringNumberProp,
+ setStringProp
+} from '../../_utils'
import type { ExtractPropTypes } from 'vue'
import type { HandleMouse, HandleChange } from '../../_interface'
diff --git a/packages/fighting-design/expand-card/__test__/expand-card.spec.ts b/packages/fighting-design/expand-card/__test__/expand-card.spec.ts
index 9b09a505a9..cc1dcb1bfe 100644
--- a/packages/fighting-design/expand-card/__test__/expand-card.spec.ts
+++ b/packages/fighting-design/expand-card/__test__/expand-card.spec.ts
@@ -4,8 +4,14 @@ import { FExpandCard } from '../index'
import type { ExpandCardImageList } from '../index'
const imageList: ExpandCardImageList = [
- { url: 'https://raw.githubusercontent.com/Tyh2001/images/master/fighting-design/1.jpg', text: '1' },
- { url: 'https://raw.githubusercontent.com/Tyh2001/images/master/fighting-design/2.jpg', text: '2' }
+ {
+ url: 'https://raw.githubusercontent.com/Tyh2001/images/master/fighting-design/1.jpg',
+ text: '1'
+ },
+ {
+ url: 'https://raw.githubusercontent.com/Tyh2001/images/master/fighting-design/2.jpg',
+ text: '2'
+ }
]
describe('FExpandCard', () => {
diff --git a/packages/fighting-design/package.json b/packages/fighting-design/package.json
index 520dd85313..052e66b42e 100644
--- a/packages/fighting-design/package.json
+++ b/packages/fighting-design/package.json
@@ -60,4 +60,4 @@
},
"homepage": "https://fighting.tianyuhao.cn",
"repository": "https://github.com/FightingDesign/fighting-design"
-}
\ No newline at end of file
+}
diff --git a/packages/fighting-design/tree/components/tree-item/interface.ts b/packages/fighting-design/tree/components/tree-item/interface.ts
index 2755e8db15..773df1851d 100644
--- a/packages/fighting-design/tree/components/tree-item/interface.ts
+++ b/packages/fighting-design/tree/components/tree-item/interface.ts
@@ -2,7 +2,7 @@ import type { FightingIcon } from '../../../_interface'
/**
* 子数每一项的类型接口
- *
+ *
* @param { string } label 标签
* @param { number } __level 层级
* @param { number | string } value 多选 checkbox 绑定的值
diff --git a/packages/fighting-design/tree/src/interface.ts b/packages/fighting-design/tree/src/interface.ts
index fb4d4537f4..ed372baa40 100644
--- a/packages/fighting-design/tree/src/interface.ts
+++ b/packages/fighting-design/tree/src/interface.ts
@@ -25,18 +25,23 @@ export type TreeData = TreeDataItem[]
/**
* 点击每一项 label 执行的回调方法类型
- *
+ *
* @param { Object } evt 事件对象
* @param { string } label label
* @param { number } level 层级
* @param { Object } isOpen 展开状态
* @param { Array } tree 格式化后的树形数据
*/
-export type TreeClickLabel = (evt: MouseEvent, model: TreeItemModel, isOpen: boolean, tree: TreeItemModel[]) => void
+export type TreeClickLabel = (
+ evt: MouseEvent,
+ model: TreeItemModel,
+ isOpen: boolean,
+ tree: TreeItemModel[]
+) => void
/**
* 注入的依赖项类型
- *
+ *
* @param { Function } onClickLabel 点击每一项 label 执行的回调方
* @param { boolean } isCheck 是否可以选择
* @param { number } offset 子节点偏移量
diff --git a/packages/fighting-design/tree/src/props.ts b/packages/fighting-design/tree/src/props.ts
index f935194f9d..b6f9cb0bf1 100644
--- a/packages/fighting-design/tree/src/props.ts
+++ b/packages/fighting-design/tree/src/props.ts
@@ -1,11 +1,16 @@
-import { setArrayProp, setBooleanProp, setFunctionProp, setNumberProp } from '../../_utils'
+import {
+ setArrayProp,
+ setBooleanProp,
+ setFunctionProp,
+ setNumberProp
+} from '../../_utils'
import type { ExtractPropTypes, InjectionKey, PropType } from 'vue'
import type { TreeData, TreeProvide, TreeClickLabel, TreeDataItem } from './interface'
export const Props = {
/** 绑定的多选值 */
modelValue: setArrayProp(),
- /**
+ /**
* 树形数据
*
* 可以是对象或者数组两种状态