66 lines
1.2 KiB
Vue
66 lines
1.2 KiB
Vue
<template>
|
||
<view class="page-nav-bar">
|
||
<view class="nav-btn left" @click="handlePrev">
|
||
<text class="arrow-icon">‹</text>
|
||
</view>
|
||
<view class="nav-btn right" @click="handleNext">
|
||
<text class="arrow-icon">›</text>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
export default {
|
||
name: 'PageNavBar',
|
||
props: {
|
||
hasPrev: { type: Boolean, default: true },
|
||
hasNext: { type: Boolean, default: true }
|
||
},
|
||
methods: {
|
||
handlePrev() {
|
||
if (!this.hasPrev) return;
|
||
this.$emit('prev');
|
||
},
|
||
handleNext() {
|
||
if (!this.hasNext) return;
|
||
this.$emit('next');
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style scoped>
|
||
.page-nav-bar {
|
||
position: fixed;
|
||
bottom: 0;
|
||
left: 0;
|
||
right: 0;
|
||
height: 110rpx;
|
||
background: #fff;
|
||
box-shadow: 0 -2rpx 16rpx rgba(0, 0, 0, 0.06);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding: 0 160rpx;
|
||
z-index: 100;
|
||
}
|
||
|
||
.nav-btn {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
width: 80rpx;
|
||
height: 80rpx;
|
||
}
|
||
|
||
.arrow-icon {
|
||
font-size: 72rpx;
|
||
color: #333;
|
||
font-weight: 300;
|
||
line-height: 1;
|
||
}
|
||
|
||
.nav-btn.right .arrow-icon {
|
||
color: #ccc;
|
||
}
|
||
</style> |