Vue 跳转到指定页面,返回到上一页


跳转到下一页
=======html
<van-cell :title="$t('mine.feedback')"
               icon="comment-circle"
               is-link
              @click="goToPage('fankui')"/>

=======JS
export default {
    data() {
       return{
          methods: {
             //不带参数的
              goToPage(name) {
               // alert("1");
                this.$router.push({name});
            },
           //或者
             onAddress(){
               this.$router.push({name:'myAddress'});
            },
           //带有参数的
           //获取商品详情
            goToDetail(sid) {
                //alert("aaa");
                this.$router.push({
                    name: "goodsDetail",
                    params: {
                        id: sid
                    }
                });
            },
           //返回上一页
           onClick() {
                this.$router.go(-1);
//或者
this.$router.back(); }, } } } }

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM