提交 79b2408c 编写于 作者: Q qiang

fix: 解决titleNView透明状态使用searchInput报错的问题

上级 4094a3a6
......@@ -6,7 +6,7 @@ export default {
mounted () {
if (this.type === 'transparent') {
const transparentElemStyle = this.$el.querySelector('.uni-page-head-transparent').style
const titleElemStyle = this.$el.querySelector('.uni-page-head__title').style
const titleElem = this.$el.querySelector('.uni-page-head__title')
const iconElems = this.$el.querySelectorAll('.uni-btn-icon')
const iconElemsStyles = []
for (let i = 0; i < iconElems.length; i++) {
......@@ -36,7 +36,9 @@ export default {
}
this._A = alpha
// TODO 暂时仅处理背景色
titleElemStyle.opacity = alpha
if (titleElem) {
titleElem.style.opacity = alpha
}
transparentElemStyle.backgroundColor = `rgba(${this._R},${this._G},${this._B},${alpha})`
borderRadiusElemsStyles.forEach(function (borderRadiusElemStyle) {
borderRadiusElemStyle.backgroundColor = `rgba(153,153,153,${1 - alpha})`
......@@ -66,4 +68,4 @@ export default {
return this.backgroundColor
}
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册