Skip to content

Usercard 人员信息卡

平台人员信息卡,常用于人员管理。

基础使用

该组件结合了 AvatarQrcode 组件。qrcode 为可扫码的卡片二维码信息,avatar 为头像地址。

查看代码
vue
<template>
	<demo-container>
		<gov-usercard
			title="XXX工作证"
			name="陈某某"
			qrcode="https://www.baidu.com/"
			avatar="/usercard.jpg"
			place="XXX社区"
			job="某某某文员"
			nums="922876444732219273"
			expiration="2020年12月1日 ~ 2030年12月1日"
		/>
	</demo-container>
</template>

自定义头部

查看代码
vue
<template>
	<demo-container class="gov-demo-usercard">
		<gov-usercard
			name="陈某某"
			qrcode="https://www.baidu.com/"
			avatar="/usercard.jpg"
			place="XXX社区"
			job="某某某文员"
			nums="922876444732219273"
			expiration="2020年12月1日 ~ 2030年12月1日"
		>
			<template #header>
				<div class="custom-header">
					<gov-danghui width="40" type="yellow" />
					<span>XXX党支部</span>
				</div>
			</template>
		</gov-usercard>
	</demo-container>
</template>

<script setup></script>
<style lang="scss">
.gov-demo-usercard {
	.custom-header {
		display: flex;
		justify-content: center;
		align-items: center;
		color: #fff;
		font-size: 30px;
		gap: 9px;
	}
}
</style>

Attributes

参数类型默认值描述
titleString-顶部标题
avatarString-头像图片的URL
nameString-姓名
numsNumber | String-编号
placeString-工作单位
jobString-职务
qrcodeString-二维码的值
backgroundString-自定义背景图的URL
expirationString-有效期

Slots

Slot Name描述
header用于自定义工作证头部内容的插槽。默认情况下,会显示传递给title属性的标题。

Released under the MIT License.