Merge pull request”更新注释文档”(#12)from feature/wyh into develop

pull/13/head
王奕辉 3 days ago
parent e8b4b16459
commit f36eed33fd

@ -1,4 +1,6 @@
<template> <template>
<!-- 进入层展示一个通知消息组件透过点击设置触发展示-->
<!-- 通过 <a-popover> 实现通知消息框配置消息流和点击事件-->
<a-popover <a-popover
v-model="visible" v-model="visible"
trigger="click" trigger="click"
@ -9,23 +11,40 @@
:overlayStyle="{ width: '300px', top: '50px' }" :overlayStyle="{ width: '300px', top: '50px' }"
> >
<template slot="content"> <template slot="content">
<!-- 透过加载线段和标签分类显示通知 -->
<a-spin :spinning="loadding"> <a-spin :spinning="loadding">
<a-tabs> <a-tabs>
<a-tab-pane tab="通知" key="1"> <a-tab-pane tab="通知" key="1">
<!-- 显示通知列表具体消息以组件形式显示 -->
<a-list> <a-list>
<a-list-item> <a-list-item>
<a-list-item-meta title="你收到了 14 份新周报" description="一年前"> <a-list-item-meta
<a-avatar style="background-color: white" slot="avatar" src="https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png"/> title="你收到了 14 份新周报"
description="一年前">
<a-avatar
style="background-color: white"
slot="avatar"
src="https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png"/>
</a-list-item-meta> </a-list-item-meta>
</a-list-item> </a-list-item>
<a-list-item> <a-list-item>
<a-list-item-meta title="你推荐的 曲妮妮 已通过第三轮面试" description="一年前"> <a-list-item-meta
<a-avatar style="background-color: white" slot="avatar" src="https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png"/> title="你推荐的 曲妮妮 已通过第三轮面试"
description="一年前">
<a-avatar
style="background-color: white"
slot="avatar"
src="https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png"/>
</a-list-item-meta> </a-list-item-meta>
</a-list-item> </a-list-item>
<a-list-item> <a-list-item>
<a-list-item-meta title="这种模板可以区分多种通知类型" description="一年前"> <a-list-item-meta
<a-avatar style="background-color: white" slot="avatar" src="https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png"/> title="这种模板可以区分多种通知类型"
description="一年前">
<a-avatar
style="background-color: white"
slot="avatar"
src="https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png"/>
</a-list-item-meta> </a-list-item-meta>
</a-list-item> </a-list-item>
</a-list> </a-list>
@ -39,6 +58,7 @@
</a-tabs> </a-tabs>
</a-spin> </a-spin>
</template> </template>
<!-- 点击回调消息分类加载功能 -->
<span @click="fetchNotice" class="header-notice"> <span @click="fetchNotice" class="header-notice">
<a-badge count="12"> <a-badge count="12">
<a-icon style="font-size: 16px; padding: 4px" type="bell" /> <a-icon style="font-size: 16px; padding: 4px" type="bell" />
@ -49,41 +69,45 @@
<script> <script>
export default { export default {
name: 'HeaderNotice', name: 'HeaderNotice', //
data () { data () {
return { return {
loadding: false, loadding: false, //
visible: false visible: false //
} }
}, },
methods: { methods: {
//
fetchNotice () { fetchNotice () {
if (!this.visible) { if (!this.visible) {
this.loadding = true this.loadding = true
//
setTimeout(() => { setTimeout(() => {
this.loadding = false this.loadding = false
}, 2000) }, 2000)
} else { } else {
this.loadding = false this.loadding = false
} }
this.visible = !this.visible this.visible = !this.visible //
} }
} }
} }
</script> </script>
<style lang="css"> <style lang="css">
.header-notice-wrapper { /* 通知框样式配置 */
.header-notice-wrapper {
top: 50px !important; top: 50px !important;
} }
</style> </style>
<style lang="less" scoped> <style lang="less" scoped>
.header-notice{ /* 层级框样式 */
.header-notice{
display: inline-block; display: inline-block;
transition: all 0.3s; transition: all 0.3s;
span { span {
vertical-align: initial; vertical-align: initial;
} }
} }
</style> </style>

Loading…
Cancel
Save