在vue中使用 this.$router.push({ path:  '/home' }) 
默认是替代本窗口
如果想新开一个窗口,可以使用下面的方式:


let routeData = this.$router.resolve({ path: '/home', query: { id: 1 } });
window.open(routeData.href, '_blank');

获取参数:
直接在被跳转的页面:this.$route.query.addflg;

如果单独加载这个列表,this.$route.query.addflg 会报错,那么就在 var t=this.$route.query?this.$route.query.addflg:'', 做个判断

如果要跳转到其他列表对应的弹框  可以直接 跳的对应的列表页面, 判断 直接调用对应的方法

项目实例:

//  this.$router.push({path:'/web/MMS/StockOut/OutBound', query: {}});

                                let routeData = this.$router.resolve({
                                    path: "/web/MMS/StockOut/OutBound",
                                    name: "OutBound",
                                    meta: {
                                        title: "出库单",
                                    },
                                    component: () =>
                                        import(
                                            "@/views/MaterialReceiving/OutBound/index.vue"
                                        ),
                                });
                                window.open(routeData.href, "_blank");

                                // this.$router.push({
                                //     path: "/web/MMS/StockOut/OutBound",
                                //     name: "OutBound",
                                //     meta: {
                                //         title: "出库单",
                                //     },
                                //     component: () =>
                                //         import(
                                //             "@/views/MaterialReceiving/OutBound/index.vue"
                                //         ),
                                // });
Logo

基于 Vue 的企业级 UI 组件库和中后台系统解决方案,为数万开发者服务。

更多推荐