2025/2/8第一次更新

This commit is contained in:
爱吃咸鱼小猫咪
2025-02-08 18:50:38 +08:00
commit d7af560866
26519 changed files with 5046029 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
import { defineMixin } from '../../libs/vue'
import defProps from '../../libs/config/props.js'
export const props = defineMixin({
props: {
bgColor: {
type: String,
default: () => defProps.statusBar.bgColor
}
}
})
+15
View File
@@ -0,0 +1,15 @@
/*
* @Author : LQ
* @Description :
* @version : 1.0
* @Date : 2021-08-20 16:44:21
* @LastAuthor : LQ
* @lastTime : 2021-08-20 17:20:39
* @FilePath : /u-view2.0/uview-ui/libs/config/props/statusBar.js
*/
export default {
// statusBar
statusBar: {
bgColor: 'transparent'
}
}
+49
View File
@@ -0,0 +1,49 @@
<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';
/**
* StatbusBar 状态栏占位
* @description 本组件主要用于状态填充,比如在自定导航栏的时候,它会自动适配一个恰当的状态栏高度。
* @tutorial https://uview-plus.jiangruyi.com/components/statusBar.html
* @property {String} bgColor 背景色 (默认 'transparent' )
* @property {String | Object} customStyle 自定义样式
* @example <u-status-bar></u-status-bar>
*/
export default {
name: 'u-status-bar',
mixins: [mpMixin, mixin, props],
data() {
return {
}
},
computed: {
style() {
const style = {}
// 状态栏高度,由于某些安卓和微信开发工具无法识别css的顶部状态栏变量,所以使用js获取的方式
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>