Skip to content

Commit

Permalink
revert: 发布新版本 0.44.0 (2023-06-18)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyh2001 committed Jun 18, 2023
1 parent 70aa970 commit e5ff453
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 13 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
English | [Chinese](https://github.com/FightingDesign/fighting-design/blob/master/CHANGELOG.md)

## 0.44.0 (2023-06-18)

- Modify the `f-tag` to close the logic and change the internal state to data startup
- Add `f-tag` component `on-click` configuration item

## 0.43.3 (2023-06-18)

- Fix style issues with `f-dialog`
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

中文 | [英文](https://github.com/FightingDesign/fighting-design/blob/master/CHANGELOG.en-US.md)

## 0.44.0 (2023-06-18)

- 修改 `f-tag` 关闭逻辑,从内部状态改为数据启动
- 新增 `f-tag` 组件 `on-click` 配置项

## 0.43.3 (2023-06-18)

- 修复 `f-dialog` 样式问题
Expand Down
3 changes: 2 additions & 1 deletion docs/components/tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@
| `size` | 标签大小 | <a href="/components/interface.html#fightingsize">FightingSize</a> | `large` `middle` `small` `mini` | small |
| `simple` | 是否为简约模式 | boolean | —— | false |
| `block` | 是否为块级元素 | boolean | —— | false |
| `on-close` | 点击关闭按钮触发的回调 | Function | —— | —— |
| `on-close` | 点击关闭按钮触发的回调 | <a href="/components/interface.html#handlemouse">HandleMouse</a> | —— | —— |
| `on-click` | 点击执行的回调 | <a href="/components/interface.html#handlemouse">HandleMouse</a> | —— | —— |

## Slots

Expand Down
5 changes: 5 additions & 0 deletions docs/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

中文 | [英文](https://github.com/FightingDesign/fighting-design/blob/master/CHANGELOG.en-US.md)

## 0.44.0 (2023-06-18)

- 修改 `f-tag` 关闭逻辑,从内部状态改为数据启动
- 新增 `f-tag` 组件 `on-click` 配置项

## 0.43.3 (2023-06-18)

- 修复 `f-dialog` 样式问题
Expand Down
2 changes: 1 addition & 1 deletion packages/fighting-design/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fighting-design",
"version": "0.43.3",
"version": "0.44.0",
"description": "Fighting design can quickly build interactive interfaces in vue3 applications, which looks good.",
"keywords": [
"fighting",
Expand Down
6 changes: 4 additions & 2 deletions packages/fighting-design/tag/src/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import { FIGHTING_SIZE, FIGHTING_TYPE } from '../../_tokens'
import type { ExtractPropTypes } from 'vue'
import type {
HandleEvent,
HandleMouse,
FightingType,
FightingSize,
FightingIcon
Expand Down Expand Up @@ -51,7 +51,9 @@ export const Props = {
/** 线性的 */
line: setBooleanProp(),
/** 点击关闭按钮触发 */
onClose: setFunctionProp<HandleEvent>()
onClose: setFunctionProp<HandleMouse>(),
/** 点击关闭按钮触发 */
onClick: setFunctionProp<HandleMouse>()
} as const

/** tag 组件 props 类型 */
Expand Down
9 changes: 2 additions & 7 deletions packages/fighting-design/tag/src/tag.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts" setup>
import { Props } from './props'
import { ref } from 'vue'
import { FSvgIcon } from '../../svg-icon'
import { FCloseBtn } from '../../close-btn'
import { useList, useRun, useGlobal } from '../../_hooks'
Expand All @@ -13,9 +12,6 @@
const { run } = useRun()
const { classes, styles } = useList(getProp(['size', 'type']), 'tag')
/** 是否展示 */
const isShow = ref<boolean>(true)
/** 类名列表 */
const classList = classes(['simple', 'type', 'size', 'block', 'round', 'line'], 'f-tag')
Expand All @@ -28,14 +24,13 @@
* @param { Object } evt 事件对象
*/
const handleClose = (evt: MouseEvent): void => {
isShow.value = false
run(prop.onClose, evt)
}
</script>

<template>
<transition name="f-tag">
<div v-if="isShow" :class="classList" :style="styleList">
<transition name="f-tag" appear>
<div :class="classList" :style="styleList" @click="onClick">
<!-- 之前的 icon -->
<f-svg-icon v-if="beforeIcon" :icon="beforeIcon" />

Expand Down
26 changes: 24 additions & 2 deletions start/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
<script lang="ts" setup></script>
<script lang="ts" setup>
import { ref } from 'vue'
<template></template>
const tags = ref([1, 2, 3, 4, 5, 6, 7, 8])
const close = (i: number): void => {
tags.value.splice(i, 1)
}
</script>

<template>
<f-space>
<f-tag
v-for="(t, i) in tags"
:key="i"
round
type="primary"
simple
close
:on-close="() => close(i)"
>
{{ t }}
</f-tag>
</f-space>
</template>

0 comments on commit e5ff453

Please sign in to comment.