lc-noticebar

通知栏组件

注意事项

  • 在导航栏下方,一般用作系统提醒、活动提醒等通知
  • 需要引起用户关注时使用,重要级别低于 Modal ,高于 Toast。
  • 文案应该简洁明了,过长将会… , 特殊情况可以设置 lines 为2行

效果

使用方法


<template>
<div class="wxc-demo">
<scroller class="scroller">
<title title="lc-noticebar"></title>
<category title="使用案例"></category>
<div class="demo">
<lc-noticebar notice="不配置参数的通告栏"></lc-noticebar>
</div>
<div class="demo">
<lc-noticebar mode="link"
:notice-url="url"
notice="测试通告,可跳转"></lc-noticebar>
</div>
<div class="demo">
<lc-noticebar :show="true"
mode="closable"
notice="测试通告,可关闭"></lc-noticebar>
</div>
<div class="demo">
<lc-noticebar type="time"
notice="请在14分25秒内完成支付,超时将取消订单"></lc-noticebar>
</div>
<div class="demo">
<lc-noticebar type="redbag"
notice="亲,你有很多很多红包可以用"></lc-noticebar>
</div>
<div class="demo">
<lc-noticebar mode="link"
notice="一条测试通告,可跳转"
type="info"
@LcNoticebarLinkClicked="LcNoticebarLinkClicked"
:notice-url="url"></lc-noticebar>
</div>
<div class="demo">
<lc-noticebar mode="closable"
notice="一条测试通告,关闭"
@LcNoticebarCloseClicked="LcNoticebarCloseClicked"
type="success"></lc-noticebar>
</div>
<div class="demo">
<lc-noticebar mode="link"
notice="一行过长自动...的测试通告,可跳转测试通告,可跳转测试通告,可跳转可跳转测试通告,可跳转"
type="question"
:notice-url="url"></lc-noticebar>
</div>
<div class="demo last-demo">
<lc-noticebar mode="closable"
notice="测试通告,可跳转测试通告,可跳转测试通告,可跳转测试通告,可跳转测试通告,可跳转"
:lines="2"
type="warn"></lc-noticebar>
</div>
</scroller>
</div>
</template>

<style scoped>

.wxc-demo {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: #FFFFFF;
}

.scroller {
flex: 1;
}

.demo {
margin-top: 40px;
}

.last-demo {
margin-bottom: 40px;
}

</style>

<script>
import Light from 'light';
const modal = Light.requireModule('modal');
import Title from 'lighting-ui/packages/_mods/title.vue';
import Category from 'lighting-ui/packages/_mods/category.vue';
import LcNoticebar from 'lighting-ui/packages/lc-noticebar';


export default {
components: { Title, Category, LcNoticebar },
data: () => ({
url: ''
}),
methods: {
LcNoticebarCloseClicked (e) {
console.log(e);
modal.toast({ 'message': 'LcNoticebarCloseClicked', 'duration': 1 });
},
LcNoticebarLinkClicked (e) {
console.log(e);
modal.toast({ 'message': 'LcNoticebarLinkClicked', 'duration': 1 });
}
}
};
</script>

可配置参数

Prop Type Required Default Description
notice String Y - 通知文案
notice-url String Y - 跳转链接,没有不跳转
mode String Y - 提示类型(右侧图标) link/closable
type String Y - 图标类型(左侧图标)success/error/info/question/time /redbag
lines Number Y 1 文案行数,取最大的行数截取

事件回调

`@LcNoticebarLinkClicked="LcNoticebarLinkClicked"`
`@LcNoticebarCloseClicked="LcNoticebarCloseClicked"`