|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view v-if="fixed && placeholder" class="nut-navbar--placeholder" :style="{ height: navHeight + 'px' }">
|
|
<view v-if="fixed && placeholder" class="nut-navbar--placeholder" :style="{ height: navHeight + 'px' }">
|
|
|
- <view :class="classes" :style="styles" ref="navBarHtml">
|
|
|
|
|
|
|
+ <view :class="classes" :style="styles" class="navBarHtml">
|
|
|
<view class="nut-navbar__left" @click="handleLeft">
|
|
<view class="nut-navbar__left" @click="handleLeft">
|
|
|
<nut-icon v-if="leftShow" color="#979797" name="left"></nut-icon>
|
|
<nut-icon v-if="leftShow" color="#979797" name="left"></nut-icon>
|
|
|
<view v-if="leftText" class="nut-navbar__text">{{ leftText }}</view>
|
|
<view v-if="leftText" class="nut-navbar__text">{{ leftText }}</view>
|
|
@@ -91,16 +91,14 @@ export default create({
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
if (fixed.value && placeholder.value) {
|
|
if (fixed.value && placeholder.value) {
|
|
|
- setTimeout(async () => {
|
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
const query = Taro.createSelectorQuery();
|
|
const query = Taro.createSelectorQuery();
|
|
|
- query
|
|
|
|
|
- .select('.navBarHtml')
|
|
|
|
|
- .boundingClientRect((rec: any) => {
|
|
|
|
|
- navHeight.value = rec.height;
|
|
|
|
|
- console.log('navBarHtml', navHeight);
|
|
|
|
|
- })
|
|
|
|
|
- .exec();
|
|
|
|
|
- }, 100);
|
|
|
|
|
|
|
+ query.select('.navBarHtml').boundingClientRect();
|
|
|
|
|
+ query.exec((res) => {
|
|
|
|
|
+ navHeight.value = res[0].height;
|
|
|
|
|
+ // console.log('navHeight', navHeight.value)
|
|
|
|
|
+ });
|
|
|
|
|
+ }, 500);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|