This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<!-- 搜索栏 -->
|
||||
<view class="search-bar">
|
||||
<view class="search-bar" :style="{ paddingTop: statusBarHeight + 'px' }">
|
||||
<view class="search-input-wrap">
|
||||
<text class="search-icon">🔍</text>
|
||||
<input
|
||||
@@ -28,6 +28,19 @@ export default {
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusBarHeight: 20
|
||||
}
|
||||
},
|
||||
created() {
|
||||
try {
|
||||
const sysInfo = uni.getSystemInfoSync()
|
||||
this.statusBarHeight = sysInfo.statusBarHeight || 20
|
||||
} catch (e) {
|
||||
this.statusBarHeight = 20
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onInput(e) {
|
||||
this.$emit('input', e.detail.value)
|
||||
@@ -50,6 +63,7 @@ export default {
|
||||
padding: 20rpx 32rpx;
|
||||
background: #ffffff;
|
||||
border-bottom: 2rpx solid #f5f5f5;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.search-input-wrap {
|
||||
flex: 1;
|
||||
|
||||
Reference in New Issue
Block a user