首页 > 其他分享 >将a-drawer修改为notification组件

将a-drawer修改为notification组件

时间:2024-03-27 18:02:05浏览次数:19  
标签:perData visible true res drawer notification 组件 data

效果图

源码

<template>
	<div>
		<a-drawer
			placement="right"
			:closable="true"
			width="560"
			:visible="visible"
			:after-visible-change="afterVisibleChange"
			@close="onClose"
			:wrapStyle="{height: '26%', zIndex: 888}"
			:mask="false"
			v-if="notifyData.length"
		>
			<div style="display: flex; flex-direction: column">
				<div class="per-item" v-for="(perData, index) in notifyData" style="padding: 6px 0">
					<div style="display: flex; flex-direction: column">
						<span>
							<a-tag color="red" v-if="perData.type === 1">{{ perData.message }}</a-tag>
							<a-tag color="green" v-else>{{ perData.message }}</a-tag>
							<span style="font-weight: 500; font-size: 15px">
								检查时间:{{ perData.checkTime }}
								隐患点:{{ perData.dangerPlace }}
							</span>
						</span>
						<div style="padding-top: 6px;
								z-index: 9999;
						 	white-space: nowrap;
  						text-overflow: ellipsis;
 								 overflow: hidden;"
								 :title="perData.description">
							隐患描述: {{ perData.description }}
						</div>
					</div>
				</div>
			</div>
		</a-drawer>
	</div>
</template>

<script>
import { loadNotifyData } from '../../api/aBus';
export default {
	name: 'notify',
	data() {
		return {
			visible: true,
			notifyData: []
		};
	},
	async mounted() {
		const res = await loadNotifyData();
		if (res.status === 0) {
			console.log('output-> res.data: ', res.data);
			this.notifyData = res.data;
			setTimeout(() => {
				this.onClose()
			}, 8000)
		}

	},
	methods: {
		afterVisibleChange(val) {
			console.log('visible', val);
		},
		showDrawer() {
			this.visible = true;
		},
		onClose() {
			this.visible = false;
		},
	}

};
</script>


<style scoped>

</style>

标签:perData,visible,true,res,drawer,notification,组件,data
From: https://www.cnblogs.com/openmind-ink/p/18099907

相关文章

  • elementui组件el-input 类型为number时,去掉上下箭头,并且解决输入中文后光标上移问题
    //去掉number输入框的上下箭头.def-input-numberinput::-webkit-outer-spin-button,.def-input-numberinput::-webkit-inner-spin-button{-webkit-appearance:none;}.def-input-numberinput[type="number"]{-moz-appearance:textfield;}//解决inputnumber框......
  • 鸿蒙HarmonyOS实战-ArkUI组件(mediaquery)
    ......
  • 求助,路过的大佬帮忙看一下!!!!elment中input组件使用prefix-icon="el-icon-search"不加载
    背景:创建了一个简单的vue工程想用测试一下el-input组件的功能,没有显示图标。代码如下所示<template><el-inputv-model="value"placeholder="请输入内容":disabled="false":show-password="true":clearable="true"prefix......
  • react 组件加上 displayName 属性的作用是什么
    react组件加上displayName属性的作用是什么在React中,为组件添加displayName属性的主要作用是方便调试和识别组件。在开发过程中,尤其是在查看浏览器开发者工具(如ReactDevTools扩展)时,displayName属性的值会显示为组件的名称,这对于追踪组件层次结构、查找特定组件以及理解组件之......
  • 在使用elment官网组件报Module parse failed: Unexpected token错误
     错误结果如下原因是当前的Vue工程不支持typescript语法需要将script中的lang="ts"去掉<template><el-radio-groupv-model="radio"><el-radio:value="3">OptionA</el-radio><el-radio:value="6">Opti......
  • Spring Cloud的原理涉及多个组件和概念
    核心部分的详细解释服务注册与发现:这是SpringCloud的核心功能之一。通过使用Eureka、Consul或Zookeeper等服务注册中心,服务提供者将自己的信息注册到注册中心,服务消费者通过注册中心查询可用的服务列表。服务消费者在需要调用其他服务时,通过注册中心找到相应的服务地址并进行......
  • iOS组件化开发之私有库
    0、了解iOS组件化1、制作开源组件库预备工作:1、安装cocoapods2、准备github账号,gitee账号,和cocoapod账号其中github,gitee账号直接在线创建即可。而注册cocoapods账号需要的终端命令:[email protected]"xxx"然后在邮箱里找到验证链接,登录一下即可。podtrunk......
  • [引]ArkTS 自定义组件
    创建自定义组件-自定义组件-基本语法-学习ArkTS语言-入门-HarmonyOS应用开发HarmonyOSDeveloper > 文档 > 指南 > 入门创建自定义组件 更新时间:2024-01-1511:55分享添加收藏在ArkUI中,UI显示的内容均为组件,由框架直接提供的称为系统组件,由开......
  • Blazor学习记录六_模版化组件_渲染模式_CSS隔离和代码隔离
    17.模版化组件在组件中放置一个可渲染的代码片段供外部调用者来传入要渲染的内容及渲染样式,这样的组件就叫做模版化的组件。一般是一个支持泛型的组件,目标为消费者封装重复使用的通用性良好的UI组件。比如一个用来给用户呈现表格数据的表格组件。示例组件GenaricTable.razor代......
  • Vue学习笔记62--多组件共享数据
    多组件共享数据main.js//引入VueimportVuefrom'vue'//引入AppimportAppfrom'./App.vue'//配置提示Vue.config.productionTip=false//引入vuex、storeimportstorefrom'./store'//默认引入index.jsnewVue({render:h=>h(App),stor......