【发布时间】:2020-04-24 18:02:47
【问题描述】:
我有News.vue 和News-View.vue。当我路由到news/1 时,它会打开News-View.vue 页面。问题是我在News.vue 中有许多搜索过滤器(类别、日期等)和无限滚动。这意味着,当用户从News-View.vue 回来时,一切都会重新渲染和刷新,并且用户的首选项会被清除。有没有办法不重新渲染News.vue 页面?
News.Vue:
beforeMount: async function () {
this.$axios.post('http://localhost/?action=news', this.filters).then((response) => {
this.results = this.results.concat(response)
})
}
附:我目前正在使用State Management 来保存加载的结果和保存的滚动位置,它可以工作,但是我想知道有没有办法不重新渲染页面,而是保存当前状态或其他东西......
【问题讨论】:
标签: vue.js