优化组件/更新
This commit is contained in:
@@ -1,26 +1,20 @@
|
||||
<template>
|
||||
<view v-if="show" class="uni-noticebar" :style="{ backgroundColor }" @click="onClick">
|
||||
<uni-icons v-if="showIcon === true || showIcon === 'true'" class="uni-noticebar-icon" type="sound"
|
||||
:color="color" :size="fontSize * 1.5" />
|
||||
<view ref="textBox" class="uni-noticebar__content-wrapper"
|
||||
:class="{
|
||||
<slot v-if="showIcon === true || showIcon === 'true'" name="noticebarIcon">
|
||||
<uni-icons class="uni-noticebar-icon" type="sound" :color="color" :size="fontSize * 1.5" />
|
||||
</slot>
|
||||
<view ref="textBox" class="uni-noticebar__content-wrapper" :class="{
|
||||
'uni-noticebar__content-wrapper--scrollable': scrollable,
|
||||
'uni-noticebar__content-wrapper--single': !scrollable && (single || moreText)
|
||||
}"
|
||||
:style="{ height: scrollable ? fontSize * 1.5 + 'px' : 'auto' }"
|
||||
>
|
||||
<view :id="elIdBox" class="uni-noticebar__content"
|
||||
:class="{
|
||||
}" :style="{ height: scrollable ? fontSize * 1.5 + 'px' : 'auto' }">
|
||||
<view :id="elIdBox" class="uni-noticebar__content" :class="{
|
||||
'uni-noticebar__content--scrollable': scrollable,
|
||||
'uni-noticebar__content--single': !scrollable && (single || moreText)
|
||||
}"
|
||||
>
|
||||
<text :id="elId" ref="animationEle" class="uni-noticebar__content-text"
|
||||
:class="{
|
||||
}">
|
||||
<text :id="elId" ref="animationEle" class="uni-noticebar__content-text" :class="{
|
||||
'uni-noticebar__content-text--scrollable': scrollable,
|
||||
'uni-noticebar__content-text--single': !scrollable && (single || showGetMore)
|
||||
}"
|
||||
:style="{
|
||||
}" :style="{
|
||||
color: color,
|
||||
fontSize: fontSize + 'px',
|
||||
lineHeight: fontSize * 1.5 + 'px',
|
||||
@@ -31,12 +25,10 @@
|
||||
'-webkit-animationPlayState': webviewHide ? 'paused' : animationPlayState,
|
||||
animationDelay: animationDelay,
|
||||
'-webkit-animationDelay': animationDelay
|
||||
}"
|
||||
>{{text}}</text>
|
||||
}">{{text}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="isShowGetMore" class="uni-noticebar__more uni-cursor-point"
|
||||
@click="clickMore">
|
||||
<view v-if="isShowGetMore" class="uni-noticebar__more uni-cursor-point" @click="clickMore">
|
||||
<text v-if="moreText.length > 0" :style="{ color: moreColor, fontSize: fontSize + 'px' }">{{ moreText }}</text>
|
||||
<uni-icons v-else type="right" :color="moreColor" :size="fontSize * 1.1" />
|
||||
</view>
|
||||
@@ -150,13 +142,18 @@
|
||||
animationDelay: '0s'
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
text(newValue, oldValue) {
|
||||
this.initSize();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isShowGetMore() {
|
||||
return this.showGetMore === true || this.showGetMore === 'true'
|
||||
},
|
||||
isShowClose() {
|
||||
return (this.showClose === true || this.showClose === 'true')
|
||||
&& (this.showGetMore === false || this.showGetMore === 'false')
|
||||
return (this.showClose === true || this.showClose === 'true') &&
|
||||
(this.showGetMore === false || this.showGetMore === 'false')
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
Reference in New Issue
Block a user