mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
parent
6967e202b4
commit
a61f765260
@ -90,7 +90,7 @@
|
|||||||
### Props
|
### Props
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 |
|
||||||
| ---------- | ---------------------------------------- | --------- | ---------- |
|
| --- | --- | --- | --- |
|
||||||
| mode | 通告栏模式,可选值为 `closeable` `link` | _string_ | `''` |
|
| mode | 通告栏模式,可选值为 `closeable` `link` | _string_ | `''` |
|
||||||
| text | 通知文本内容 | _string_ | `''` |
|
| text | 通知文本内容 | _string_ | `''` |
|
||||||
| color | 通知文本颜色 | _string_ | `#ed6a0c` |
|
| color | 通知文本颜色 | _string_ | `#ed6a0c` |
|
||||||
@ -112,7 +112,8 @@
|
|||||||
### Slot
|
### Slot
|
||||||
|
|
||||||
| 名称 | 说明 |
|
| 名称 | 说明 |
|
||||||
| ---------- | -------------- |
|
| ---------- | ---------------------------------------- |
|
||||||
|
| - | 通知文本内容,仅在 `text` 属性为空时有效 |
|
||||||
| left-icon | 自定义左侧图标 |
|
| left-icon | 自定义左侧图标 |
|
||||||
| right-icon | 自定义右侧图标 |
|
| right-icon | 自定义右侧图标 |
|
||||||
|
|
||||||
|
@ -6,11 +6,7 @@ VantComponent({
|
|||||||
text: {
|
text: {
|
||||||
type: String,
|
type: String,
|
||||||
value: '',
|
value: '',
|
||||||
observer() {
|
observer: 'init',
|
||||||
wx.nextTick(() => {
|
|
||||||
this.init();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
mode: {
|
mode: {
|
||||||
type: String,
|
type: String,
|
||||||
@ -31,11 +27,7 @@ VantComponent({
|
|||||||
speed: {
|
speed: {
|
||||||
type: Number,
|
type: Number,
|
||||||
value: 50,
|
value: 50,
|
||||||
observer() {
|
observer: 'init',
|
||||||
wx.nextTick(() => {
|
|
||||||
this.init();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
scrollable: {
|
scrollable: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@ -66,8 +58,13 @@ VantComponent({
|
|||||||
this.timer && clearTimeout(this.timer);
|
this.timer && clearTimeout(this.timer);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
|
requestAnimationFrame(() => {
|
||||||
Promise.all([
|
Promise.all([
|
||||||
getRect(this, '.van-notice-bar__content'),
|
getRect(this, '.van-notice-bar__content'),
|
||||||
getRect(this, '.van-notice-bar__wrap'),
|
getRect(this, '.van-notice-bar__wrap'),
|
||||||
@ -99,6 +96,7 @@ VantComponent({
|
|||||||
this.scroll();
|
this.scroll();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
scroll() {
|
scroll() {
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
<view class="van-notice-bar__wrap">
|
<view class="van-notice-bar__wrap">
|
||||||
<view class="van-notice-bar__content {{ !scrollable && !wrapable ? 'van-ellipsis' : '' }}" animation="{{ animationData }}">
|
<view class="van-notice-bar__content {{ !scrollable && !wrapable ? 'van-ellipsis' : '' }}" animation="{{ animationData }}">
|
||||||
{{ text }}
|
{{ text }}
|
||||||
|
<slot wx:if="{{ !text }}"></slot>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user