12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <template>
- <view
- :style="[style]"
- class="u-status-bar"
- >
- <slot />
- </view>
- </template>
- <script>
- import { props } from './props';
- import { mpMixin } from '../../libs/mixin/mpMixin';
- import { mixin } from '../../libs/mixin/mixin';
- import { addUnit, addStyle, deepMerge, sys } from '../../libs/function/index';
-
- export default {
- name: 'u-status-bar',
- mixins: [mpMixin, mixin, props],
- data() {
- return {
- }
- },
- computed: {
- style() {
- const style = {}
-
- style.height = addUnit(sys().statusBarHeight, 'px')
- style.backgroundColor = this.bgColor
- return deepMerge(style, addStyle(this.customStyle))
- }
- },
- }
- </script>
- <style lang="scss" scoped>
- .u-status-bar {
- // nvue会默认100%,如果nvue下,显式写100%的话,会导致宽度不为100%而异常
- /* #ifndef APP-NVUE */
- width: 100%;
- /* #endif */
- }
- </style>
|