优化组件/更新

This commit is contained in:
gyq
2025-12-03 10:13:55 +08:00
parent 92f9776a35
commit 09b6e36a52
261 changed files with 22080 additions and 7238 deletions

View File

@@ -1,3 +1,7 @@
## 1.2.32025-04-14
- 新增 左侧自定义插槽,可自定义文字或图标
## 1.2.22023-12-20
- 修复动态绑定title时滚动速度不一致的问题
## 1.2.12022-09-05
- 新增 属性 fontSize可修改文字大小。
## 1.2.02021-11-19

View File

@@ -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() {

View File

@@ -1,7 +1,7 @@
{
"id": "uni-notice-bar",
"displayName": "uni-notice-bar 通告栏",
"version": "1.2.1",
"version": "1.2.3",
"description": "NoticeBar 通告栏组件,常用于展示公告信息,可设为滚动公告",
"keywords": [
"uni-ui",
@@ -46,12 +46,15 @@
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
"aliyun": "y",
"alipay": "n"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
"app-vue": "y",
"app-nvue": "y",
"app-harmony": "u",
"app-uvue": "u"
},
"H5-mobile": {
"Safari": "y",