[improvement] NoticeBar: update style (#699)

This commit is contained in:
neverland 2018-10-08 16:52:52 +08:00 committed by GitHub
parent 21fcadf1d4
commit 464fccd155
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 15 deletions

View File

@ -57,8 +57,8 @@
| speed | 滚动速率 (px/s) | `Number` | `50` |
| scrollable | 是否在长度溢出时滚动播放 | `Boolean` | `true` |
| left-icon | 左侧图标图片 URL | `String` | - |
| color | 文本颜色 | `String` | `#f60` |
| background | 滚动条背景 | `String` | `#fff7cc` |
| color | 文本颜色 | `String` | `#ed6a0c` |
| background | 滚动条背景 | `String` | `#fffbe8` |
| open-type | 微信开放能力 | `String` | `navigate` |
### Event

View File

@ -1,18 +1,19 @@
.van-notice-bar {
display: flex;
padding: 9px 10px;
font-size: 12px;
line-height: 1.5;
height: 40px;
padding: 0 15px;
font-size: 14px;
line-height: 24px;
align-items: center;
&--within-icon {
position: relative;
padding-right: 30px;
padding-right: 40px;
}
&__left-icon {
height: 18px;
min-width: 20px;
padding-top: 1px;
box-sizing: border-box;
> image {
@ -24,20 +25,23 @@
&__right-icon {
position: absolute;
top: 10px;
right: 10px;
font-size: 15px;
line-height: 1;
right: 15px;
font-size: 16px;
}
&__content-wrap {
position: relative;
flex: 1;
height: 18px;
height: 24px;
overflow: hidden;
position: relative;
}
&__content {
position: absolute;
white-space: nowrap;
&.van-ellipsis {
max-width: 100%;
}
}
}

View File

@ -1,7 +1,7 @@
import { VantComponent } from '../common/component';
const FONT_COLOR = '#f60';
const BG_COLOR = '#fff7cc';
const FONT_COLOR = '#ed6a0c';
const BG_COLOR = '#fffbe8';
VantComponent({
props: {

View File

@ -8,7 +8,7 @@
<image src="{{ leftIcon }}" />
</view>
<view class="van-notice-bar__content-wrap">
<view class="van-notice-bar__content" animation="{{ animationData }}">
<view class="van-notice-bar__content {{ scrollable ? '' : 'van-ellipsis' }}" animation="{{ animationData }}">
{{ text }}
</view>
</view>