vue 打开新窗口传参以及新窗口接受参数
2019-07-26 11:44
1726 查看
主体页面代码:
[code]<div class="open" @click="open()">打开新窗口带参数</div>
[code] methods: { open () { const {href} = this.$router.resolve({ path: '/novelList', query: { pdf: 77 } }) window.open(href, '_blank') } }
新窗口页面接受参数:
[code] created() { this.getParams(); }, methods: { getParams() { // 取到路由带过来的参数 const routerParams = this.$route.query.pdf; console.log("接受的pdf的值:", routerParams); } }
注意: “const routerParams = this.$route.query.pdf;”,中的pdf与主体页面query中的pdf一致;
相关文章推荐
- mui打开新窗口并传参以及获得参数
- vue,router-link传参以及参数的使用
- vue,router-link传参以及参数的使用
- vue使用router-link :to="{path:'/index'}"传参以及参数的使用
- vue学习五 router-link传参以及参数的使用
- vue,router-link传参以及参数的使用
- mybatis+mysql时间查询以及map传参,controller接受时间日期类型的参数
- 我的vue.js学习之路(vue中router-link传参以及参数的使用)
- Vue 跳转路由传参以及获取参数
- vue,router-link传参以及参数的使用
- 参数传递(续)之——用Ref和Out关键字的按引用传递,以及用Params关键字传参
- window.open窗口打开参数
- vue中如何带参数打开新的html
- js window.open打开新窗口 参数
- 用javascript实现始终保持打开同一个子窗口以及关闭父窗口同时自动关闭所有子窗口
- Spring 向页面传值以及接受页面传过来的参数的方式
- Vue中在新窗口打开页面及Vue-router的使用
- 打开新窗口的window.open使用方法以及最大化等问题解
- javascript 打开新窗口以及窗体传值
- mini.open打开窗口时传递参数