-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from nancyzhan/master
1.7.5版本更新
- Loading branch information
Showing
11 changed files
with
138 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# BNavHeader | ||
提供页面顶部的标题返回栏 | ||
|
||
## 组件注册 | ||
|
||
```js | ||
import { BNavHeader } from '@fesjs/traction-widget'; | ||
app.use(BNavHeader); | ||
``` | ||
## 代码演示 | ||
### 基础用法 | ||
传入导航栏数据,生成导航。 | ||
|
||
--USE | ||
|
||
--CODE | ||
|
||
## 参数说明 | ||
### BNavHeader Props | ||
| 属性 | 说明 | 类型 | 默认值 |是否必须| | ||
| ----- | ----------------------------- | ---------------------------------------- |------------------ |----- | | ||
| title | 顶部栏标题 | String | - | 是 | ||
| isShowArrow | 是否显示返回箭头 | Boolean | true | 否 | ||
### BNavHeader Events | ||
| 事件名称 | 说明 | 回调参数 | | ||
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | | ||
| back | 点击返回箭头时触发的回调函数 | - | ||
### BNavHeader Slots | ||
| 名称 | 说明 | 参数 | | ||
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | | ||
| suffix | 后缀内容 | - | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<template> | ||
<div> | ||
<BNavHeader title="顶部栏标题" @back="handleBack"> | ||
<template v-slot:suffix> | ||
<div>后缀内容</div> | ||
</template> | ||
</BNavHeader> | ||
<div class="eg-page">页面内容</div> | ||
</div> | ||
</template> | ||
<script setup lang="ts"> | ||
import { ref, watch, h } from 'vue'; | ||
import { BNavHeader } from '@fesjs/traction-widget'; | ||
import { FMessage } from '@fesjs/fes-design'; | ||
const handleBack = () => { | ||
FMessage.info('自定义返回逻辑'); | ||
}; | ||
</script> | ||
<style lang='less' scoped> | ||
.eg-page { | ||
padding: 24px; | ||
background: #fff; | ||
border-radius: 4px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@fesjs/traction-widget", | ||
"version": "1.7.4", | ||
"version": "1.8.0", | ||
"description": "集合大型中台项目使用到的通用组件和工具函数", | ||
"scripts": { | ||
"docs:dev": "npm run build && vitepress dev docs", | ||
|
@@ -28,7 +28,8 @@ | |
"url": "[email protected]:WeBankFinTech/TractionWidget.git" | ||
}, | ||
"keywords": [ | ||
"traction","widget" | ||
"traction", | ||
"widget" | ||
], | ||
"author": "[email protected]", | ||
"license": "MIT", | ||
|
39 changes: 39 additions & 0 deletions
39
packages/traction-widget/components/NavHeader/NavHeader.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<template> | ||
<div class="wd-nav-header"> | ||
<LeftOutlined v-if="isShowArrow" class="back" @click="handleArrowClick" /> | ||
<div class="name">{{title}}</div> | ||
<div v-if="isSlot" class="suffix"> | ||
<slot name="suffix"></slot> | ||
</div> | ||
</div> | ||
</template> | ||
<script setup lang="ts"> | ||
import { defineProps, defineEmits, useSlots } from 'vue'; | ||
import { LeftOutlined } from '@fesjs/fes-design/icon'; | ||
const isSlot = !!useSlots().suffix; | ||
// eslint-disable-next-line no-unused-vars | ||
const props = defineProps({ | ||
title: { | ||
type: String, | ||
required: true | ||
}, | ||
isShowArrow: { | ||
type: Boolean, | ||
required: false, | ||
default: true | ||
} | ||
}); | ||
const emit = defineEmits(['back']); | ||
const handleArrowClick = () => { | ||
emit('back'); | ||
}; | ||
</script> | ||
<script lang="ts"> | ||
export default { | ||
name: 'BNavHeader' | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { withInstall } from '../_util/withInstall'; | ||
import NavHeader from './NavHeader.vue'; | ||
|
||
import type { SFCWithInstall } from '../_util/interface'; | ||
|
||
type NavHeaderType = SFCWithInstall<typeof NavHeader>; | ||
export const BNavHeader = withInstall<NavHeaderType>(NavHeader as NavHeaderType); | ||
|
||
export default BNavHeader; |
19 changes: 19 additions & 0 deletions
19
packages/traction-widget/components/NavHeader/style/index.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.wd-nav-header { | ||
display: flex; | ||
align-items: center; | ||
padding-bottom: 16px; | ||
.back { | ||
color: #93949B; | ||
height: 24px; | ||
width: 24px; | ||
transform: scale(1.8); | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
.name { | ||
font-size: 24px; | ||
color: #0F1222; | ||
margin: 0 12px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import './index.less'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters