需要开发 IM
This commit is contained in:
@@ -9,6 +9,11 @@
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
/** 是否显示左侧返回按钮 */
|
||||
showBack: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
/** 导航栏颜色 */
|
||||
targetColor: {
|
||||
type: String,
|
||||
@@ -39,7 +44,7 @@
|
||||
const emits = defineEmits(['onBack'])
|
||||
|
||||
// 判断是否传入了名为 "back" 的插槽
|
||||
const hasBackSlot = !!slots.back
|
||||
const hasBackSlot = computed(() => !!slots.back)
|
||||
/** 全局存储当前滚动位置(供 computed 使用) */
|
||||
const currentScrollTop = ref(0)
|
||||
/** 缓存 rpx 转 px 的比例 */
|
||||
@@ -118,9 +123,10 @@
|
||||
</view>
|
||||
<view class="nav-bar-box">
|
||||
<!-- 左侧插槽 -->
|
||||
<view @click="onBack">
|
||||
<view @click="props.showBack && onBack()">
|
||||
<!-- -->
|
||||
<image
|
||||
v-if="!hasBackSlot"
|
||||
v-if="props.showBack && !hasBackSlot"
|
||||
src="/static/images/login/back.png"
|
||||
mode="heightFix"
|
||||
class="top_left-icon"
|
||||
|
||||
Reference in New Issue
Block a user