iview Badge组件count传值

本文介绍了一种用于显示通知未读数的Badge组件及其使用方法。Badge组件能够帮助用户直观地了解未读消息数量,并通过点击进行查看。文章详细展示了如何设置静态和动态的未读数量。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Badge 徽标数

概述

  #

主要用于通知未读数的角标,提醒用户点击。


<style scoped>
    .demo-badge{
        width: 42px;
        height: 42px;
        background: #eee;
        border-radius: 6px;
        display: inline-block;
    }
</style>
<template>
    <Badge count="3">
        <a href="#" class="demo-badge"></a>
    </Badge>
</template>
<script>
    export default {
        
    }
</script>

count是代表个数,如果要动态传值,可以使用:count="value" 

例如 


<ul>
                                        <li v-for="f in friend">
                                        <a href="#">
                                            <div style="float: left">
                                                <img src="../../img/user2.png" alt="">
                                            </div>


                                            <div style="float: left">
                                                <p style="font-size: 14px;color: #333;margin-top: 6px;margin-left: 10px;" > {{f.displayName}}</p>
                                                <span style="font-size: 12px;color: #a6a6a6;margin-top: 6px;margin-left: 10px;" v- if="f.signaTure ==null">还没有签名!</span>
                                                <span style="font-size: 12px;color: #a6a6a6;margin-top: 6px;margin-left: 10px;" v- else="f.signaTure !=null">{{f.signaTure}}</span>
                                            </div>
                                            <div style="float: right;margin-top: 16px;margin-right: 10px;" >
                                                <Badge :count="f.tourNumber">
                                                    <a href="#" class="demo-badge"></a>
                                                </Badge>
                                            </div>
                                        </a>
                                        </li>
                                    </ul>



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值