Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

vue-router路由参数刷新消失的问题

$
0
0

页面使用vue-router在跳转时发的参数有用来给下一个页面请求数据用的。在进入页面后再次刷新,参数就消失了。想询问一下可行的解决方案。 这是上个页面跳转写的。 image.png这边是从上个页面接收这个参数请求数据

methods: {
            init() {
                console.log(this.$route.params.articleId);
                this.params = this.$route.params;
                this.articleId = this.params.articleId;
                this.getArticleDetail(this.articleId);
            },
            getArticleDetail(id) {
                this.$http({
                    method: "GET",
                    url: "/getData/getArticleDetail",
                    params: {
                        id: id
                    },
   		  ...
        },

进入页面后再次刷新的话请求的数据就没有了。所以后台报错 请教一下合适的解决方案…万分感谢


Viewing all articles
Browse latest Browse all 14821

Trending Articles