Skip to content

Commit

Permalink
feat: 优化样式动态绑定过长的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhenfei committed Jul 27, 2020
1 parent df7d049 commit ab73b14
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions components/pi-popup/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@
<view
class="pi-rela pi-w-100P pi-h-100P"
:class="{ 'pi-safearea': !['top', 'center'].includes(position) && safeAreaInsetBottom }"
:style="{
background: background,
paddingTop:
!['bottom', 'center'].includes(position) && safeAreaInsetTop ? statusBarHeight : 0
}"
:style="contentStyle"
>
<view
v-if="showCloseIcon"
Expand Down Expand Up @@ -194,6 +190,15 @@ export default {
}
return positionStyleMap[this.position]
},
contentStyle() {
return {
background: this.background,
paddingTop:
!['bottom', 'center'].includes(this.position) && this.safeAreaInsetTop
? this.statusBarHeight
: 0
}
},
getDuration() {
const duration = parseInt(this.duration)
return {
Expand Down

0 comments on commit ab73b14

Please sign in to comment.