Commit 421b524f by 前端

新增前后页参数

1 parent 4a674fdf
......@@ -2,14 +2,14 @@
<div>
<!-- 左箭头 开始 -->
<div class="left_arrow">
<img src="@/assets/images/arrow_left.png" class="img" alt="" />
<img src="@/assets/images/arrow_left.png" class="img" alt="" @click="leftClickEvent" />
<img src="@/assets/images/arrow_circle.png" class="circle" alt="" />
</div>
<!-- 左箭头 end -->
<!-- 右箭头 开始 -->
<div class="right_arrow">
<img src="@/assets/images/arrow_right.png" class="img" alt="" />
<img src="@/assets/images/arrow_right.png" class="img" alt="" @click="rightClickEvent" />
<img src="@/assets/images/arrow_circle.png" class="circle" alt="" />
</div>
<!-- 右箭头 end -->
......@@ -18,8 +18,37 @@
<script>
export default {
name: 'FixedArrow',
props: {
// 前一页的url参数
prevUrl: {
type: String,
default: ''
},
// 下一页的url参数
nextUrl: {
type: String,
default: ''
}
},
data() {
return {}
},
methods: {
// 左侧箭头点击事件
leftClickEvent() {
this.$emit('prev')
if (this.prevUrl) {
this.$router.push({ path: this.prevUrl })
}
},
// 右侧箭头点击事件
rightClickEvent() {
this.$emit('next')
if (this.nextUrl) {
this.$router.push({ path: this.nextUrl })
}
}
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!