brower-system-wx.js
\public\config-open\brower-system-wx.js
,
changeTitle(title){
if(window.$bowUtil.isWechatMini()){
window.document.title=title;
return false;
}
window.document.title=title;
return false;
}
bs-back.vue
<template>
<van-sticky v-show="visible">
<section class="bs-back">
<van-nav-bar
v-bind="$attrs"
@click-left="onClickLeft"
@click-right="onClickRight"
/>
</section>
</van-sticky>
</template>
<style></style>
<script>
//统一跳转控制
import { goBack as toBacKUrl } from "@/utils/request-link";
export default {
name: "bs-back",
data() {
return {
visible:true
}
},
mounted() {
this.visible= window.$bowUtil.changeTitle(this.$attrs.title)
},
methods: {
goBack() {
if (this.doBack === null || this.doBack === undefined) {
// window.history.go(-1);
toBacKUrl();
} else {
this.doBack();
}
},
onClickLeft() {
if (this.doClickLeft === null || this.doClickLeft === undefined) {
// window.history.go(-1);
toBacKUrl();
} else {
this.doClickLeft();
}
},
onClickRight() {
this.$emit("on-click-right");
},
},
// watch:{
// "value.title": function (to, from) {
// window.document.title=to;
// },
// },
props: {
value: {
type: Object,
default: () => {},
},
doBack: {
type: Function,
default: null,
},
doClickLeft: {
type: Function,
default: null,
},
},
beforeRouteEnter(to, from, next) {
// console.log(to);
next((vm) => {
vm.$router.replace(from.path);
});
},
};
</script>
文档更新时间: 2023-06-12 19:13 作者:admin