提交 d19275ef 编写于 作者: Q qiang

fix: 解决titleNView内button未设置text导致报错的问题

上级 87b48861
{ {
"name": "@dcloudio/uni-h5", "name": "@dcloudio/uni-h5",
"version": "0.3.0", "version": "0.3.1",
"description": "uni-app h5", "description": "uni-app h5",
"main": "dist/index.umd.min.js", "main": "dist/index.umd.min.js",
"scripts": { "scripts": {
......
...@@ -6,12 +6,12 @@ ...@@ -6,12 +6,12 @@
class="uni-page-head" class="uni-page-head"
> >
<div class="uni-page-head-hd"> <div class="uni-page-head-hd">
<div <div
v-show="backButton" v-show="backButton"
class="uni-page-head-btn" class="uni-page-head-btn"
@click="_back"> @click="_back">
<i <i
:style="{color:color,fontSize:'27px'}" :style="{color:color,fontSize:'27px'}"
class="uni-btn-icon">&#xe601;</i> class="uni-btn-icon">&#xe601;</i>
</div> </div>
<template v-for="(btn,index) in btns"> <template v-for="(btn,index) in btns">
...@@ -32,15 +32,15 @@ ...@@ -32,15 +32,15 @@
</div> </div>
</template> </template>
</div> </div>
<div <div
v-if="!searchInput" v-if="!searchInput"
class="uni-page-head-bd"> class="uni-page-head-bd">
<div <div
:style="{fontSize:titleSize,opacity:type==='transparent'?0:1}" :style="{fontSize:titleSize,opacity:type==='transparent'?0:1}"
class="uni-page-head__title" class="uni-page-head__title"
> >
<i <i
v-if="loading" v-if="loading"
class="uni-loading"/> class="uni-loading"/>
{{ titleText }} {{ titleText }}
</div> </div>
...@@ -89,8 +89,8 @@ ...@@ -89,8 +89,8 @@
</template> </template>
</div> </div>
</div> </div>
<div <div
v-if="type!=='transparent'" v-if="type!=='transparent'"
class="uni-placeholder"/> class="uni-placeholder"/>
</uni-page-head> </uni-page-head>
</template> </template>
...@@ -371,7 +371,7 @@ export default { ...@@ -371,7 +371,7 @@ export default {
btn.fontFamily = fontFamily btn.fontFamily = fontFamily
} }
btn.color = this.type === 'transparent' ? '#fff' : (btn.color || this.textColor) btn.color = this.type === 'transparent' ? '#fff' : (btn.color || this.textColor)
let fontSize = btn.fontSize || (this.type === 'transparent' || btn.text.indexOf('\\u') >= 0 ? '22px' : '27px') let fontSize = btn.fontSize || (this.type === 'transparent' || /\\u/.test(btn.text) ? '22px' : '27px')
if (/\d$/.test(fontSize)) { if (/\d$/.test(fontSize)) {
fontSize += 'px' fontSize += 'px'
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册