Skip to content

Commit

Permalink
perf: 优化 f-drawer f-dialog 组件样式
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyh2001 committed Aug 8, 2023
1 parent 61ad3b0 commit 1f68ef0
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 63 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/.vitepress/dist
publish_branch: gh-pages # 将部署到 gh-pages 分支
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

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

- 优化 `f-drawer` `f-dialog` 组件样式

## 0.60.0 (2023-08-04)

- 优化 `f-radio` 组件样式
Expand Down
1 change: 1 addition & 0 deletions docs/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fighting.tianyuhao.cn
36 changes: 0 additions & 36 deletions docs/components/demos/drawer/demo1.vue

This file was deleted.

15 changes: 0 additions & 15 deletions docs/components/demos/drawer/demo2.vue

This file was deleted.

57 changes: 47 additions & 10 deletions docs/components/drawer.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,28 @@
::: demo

<template #source>
<demo1-vue />
<f-space>
<f-button type="primary" @click="onShow('left')">从左往右开</f-button>
<f-button type="primary" @click="onShow('right')">从右往左开</f-button>
<f-button type="primary" @click="onShow('top')">从上往下开</f-button>
<f-button type="primary" @click="onShow('bottom')">从下往上开</f-button>
</f-space>

<f-drawer v-model:visible="visible1" title="Title" :direction="direction">
<h3>沁园春·雪</h3>

<p>北国风光,千里冰封,万里雪飘。</p>
<p>望长城内外,惟余莽莽;大河上下,顿失滔滔。</p>
<p>山舞银蛇,原驰蜡象,欲与天公试比高。</p>
<p>须晴日,看红装素裹,分外妖娆。</p>

<br />

<p>江山如此多娇,引无数英雄竞折腰。</p>
<p>惜秦皇汉武,略输文采;唐宗宋祖,稍逊风骚。</p>
<p>一代天骄,成吉思汗,只识弯弓射大雕。</p>
<p>俱往矣,数风流人物,还看今朝。</p>
</f-drawer>
</template>

```html
Expand Down Expand Up @@ -64,24 +85,31 @@
::: demo

<template #source>
<demo2-vue />

<div>
<f-button type="primary" @click="visible2 = true">打开</f-button>
<f-drawer v-model:visible="visible2" title="Title" size="50%" append-to-body>
<f-button type="primary" @click="visible3 = true">打开内层 drawer</f-button>
<f-drawer v-model:visible="visible3" title="Title"> 内层 drawer </f-drawer>
</f-drawer>
</div>
</template>

```html
<template>
<f-button type="primary" @click="visible4 = true">打开</f-button>
<f-button type="primary" @click="visible2 = true">打开</f-button>

<f-drawer title="Title" append-to-body v-model:visible="visible4">
<f-button type="primary" @click="visible5 = true">打开内层 drawer</f-button>
<f-drawer title="Title" v-model:visible="visible5"> 内层 drawer </f-drawer>
<f-drawer title="Title" append-to-body v-model:visible="visible2">
<f-button type="primary" @click="visible3 = true">打开内层 drawer</f-button>
<f-drawer title="Title" v-model:visible="visible3"> 内层 drawer </f-drawer>
</f-drawer>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
const visible4 = ref(false)
const visible5 = ref(false)
const visible2 = ref(false)
const visible3 = ref(false)
</script>
```

Expand Down Expand Up @@ -143,6 +171,15 @@ type DrawerDirection = 'left' | 'top' | 'right' | 'bottom'
</a>
<script setup lang="ts">
import demo1Vue from './demos/drawer/demo1.vue'
import demo2Vue from './demos/drawer/demo2.vue'
import { ref } from 'vue'
const visible1 = ref(false)
const visible2 = ref(false)
const visible3 = ref(false)
const direction = ref('right')
const onShow = (dir: string): void => {
direction.value = dir
visible1.value = true
}
</script>
2 changes: 1 addition & 1 deletion packages/fighting-theme/src/dialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
right: 0;
left: 0;
bottom: 0;
z-index: var(--dialog-z-index);
z-index: var(--dialog-z-index, 2000);

// 遮罩层
&__mask {
Expand Down
2 changes: 1 addition & 1 deletion packages/fighting-theme/src/drawer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
right: 0;
left: 0;
bottom: 0;
z-index: var(--drawer-z-index);
z-index: var(--drawer-z-index, 2000);

// 不同方向
&__top .f-drawer__container {
Expand Down

0 comments on commit 1f68ef0

Please sign in to comment.