Skip to content

Commit

Permalink
fix: 修复部分类型强制转换 🖲️🖲️🖲️
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyh2001 committed Feb 16, 2023
1 parent 21dc4ba commit 7c1b82c
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 60 deletions.
1 change: 0 additions & 1 deletion docs/.vitepress/theme/components/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export { searchList } from './search-list'
export { footerList } from './footer-list'
export { contributors } from './contributors'
export { rotate } from './rotate'
31 changes: 0 additions & 31 deletions docs/.vitepress/theme/components/src/rotate.ts

This file was deleted.

19 changes: 1 addition & 18 deletions docs/.vitepress/theme/components/vp-home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@
</template>

<script lang="ts" setup>
import { footerList, contributors, rotate } from './src'
rotate()
import { footerList, contributors } from './src'
</script>

<style lang="scss" scoped>
Expand Down Expand Up @@ -149,21 +147,6 @@
height: 120px;
user-select: none;
display: block;
&.fighting__logo__rotate {
animation: logo-animation 1s linear infinite;
}
// loading 动画
@keyframes logo-animation {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
}
// 标题
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/components/vp-search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
const isShow = ref(false)
/** 搜索结果列表 */
const resultList = ref(null as unknown as SearchList)
const resultList = ref<SearchList>()
/** 按下回车触发搜索 */
const onSearch = (): void => {
Expand Down
4 changes: 2 additions & 2 deletions docs/components/number-animate.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
import { ref } from 'vue'
import type { NumberAnimateInstance } from 'fighting-design'
const animate = ref(null as unknown as NumberAnimateInstance)
const animate = ref<NumberAnimateInstance>()
const change = (): void => {
animate.value.run()
Expand Down Expand Up @@ -129,7 +129,7 @@ type AnimationEnd = (elapsed: number) => void
<script setup lang="ts">
import { ref } from 'vue'
const animate = ref(null as unknown as NumberAnimateInstance)
const animate = ref<NumberAnimateInstance>()
const change = (): void => {
animate.value.run()
Expand Down
4 changes: 2 additions & 2 deletions packages/fighting-design/_hooks/use-list/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const useList = <T extends object>(prop: T, name: string): UseListReturn
classList.value.push(`f-${name}__${isBoolean(propList[key]) ? convertFormat(key) : propList[key]}`)
}
}
return classList.value as unknown as ClassList
return classList.value
})
}

Expand Down Expand Up @@ -118,7 +118,7 @@ export const useList = <T extends object>(prop: T, name: string): UseListReturn
}
}

return styleList as unknown as CSSProperties
return styleList
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
} as const
/** 获取当前元素的索引 */
const index = target.index as unknown as keyof OptionMap
const index: keyof OptionMap = target.index as unknown as keyof OptionMap
optionMap[index] && optionMap[index]()
}
Expand Down
4 changes: 2 additions & 2 deletions packages/fighting-design/trigger/src/trigger.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
/**
* 获取点击的孩子节点是否存在 f-trigger 类名的标签
*
* @see composedPath https://developer.mozilla.org/zh-CN/docs/Web/API/Event/composedPath
* @see some https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/some
* @see Event.composedPath() https://developer.mozilla.org/zh-CN/docs/Web/API/Event/composedPath
* @see Array.prototype.some() https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/some
*/
const isHaveTrigger: boolean = (evt.composedPath() as HTMLElement[]).some(
(item: HTMLElement): boolean => item.className === 'f-trigger'
Expand Down
1 change: 1 addition & 0 deletions packages/fighting-design/up-load/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { install } from '../_utils'

export const FUpLoad = install(UpLoad)

/** up-load 组件实例类型 */
export type UpLoadInstance = InstanceType<typeof UpLoad>

export * from './src/interface.d'
Expand Down
1 change: 1 addition & 0 deletions packages/fighting-design/up-load/src/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ export const Props = {
onChange: setFunctionProp<UpLoadCallback>()
} as const

/** up-load 组件 props 类型 */
export type UpLoadProps = ExtractPropTypes<typeof Props>
4 changes: 2 additions & 2 deletions packages/fighting-design/up-load/src/up-load.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
const dragIng = ref(false)
/** 文件列表 */
const fileList = ref<File[]>(null as unknown as File[])
const fileList = ref<File[]>()
/** 文件上传输入框 */
const inputEl = ref<HTMLInputElement>()
Expand Down Expand Up @@ -83,7 +83,7 @@
* @param { number } index 需要删除的文件索引
*/
const removeFile = (index: number): void => {
fileList.value.splice(index, 1)
fileList.value && fileList.value.splice(index, 1)
}
/**
Expand Down
1 change: 1 addition & 0 deletions packages/fighting-design/watermark/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { install } from '../_utils'

export const FWatermark = install(Watermark)

/** watermark 组件实例类型 */
export type WatermarkInstance = InstanceType<typeof Watermark>

export * from './src/interface.d'
Expand Down
1 change: 1 addition & 0 deletions packages/fighting-design/watermark/src/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ export const Props = {
zIndex: setNumberProp(100)
} as const

/** watermark 组件 props 类型 */
export type WatermarkProps = ExtractPropTypes<typeof Props>

0 comments on commit 7c1b82c

Please sign in to comment.