我有一个Nuxt页面,我想在不使用按钮上的方法重新呈现或刷新页面的情况下更改路由路径。 如果我使用this.$router.push()或replace(),页面将刷新,如果我使用window.history.pushState()或replaceState(),则页面将正常工作,但之后,如果我在页面上添加this.$router.push({ query: a = b })查询,则页面将刷新,因为使用window.history更改路由不会更改$route,并且当我使用this.$router.push时,Vue Router会认为这是一个不同的页面。 我已经在网上搜索了很多次,没有找到任
我的Nuxt.js网站有问题。我定义了一个页面,其中包含一个动态的段塞参数,如下所示:
/solutions/:slug
如果我在浏览器中直接访问该页面,它将正确加载!但是,如果我在NavBar组件中单击nuxt链接,就会在控制台中得到以下错误,并且页面不会加载:
vue.runtime.esm.js?2b0e:619
[Vue warn]: Failed to mount component: template or render function not defined.
found in
---> <Anonymous>
<Nuxt>
当我添加一个新的查询时,使用$router.push路由Nuxt,watchQuery不工作,asyncData不取api,重新装入子组件。请注意“新查询”,默认情况下不存在任何查询。(创建新查询后,然后存在查询,所有内容都是正确的,watchQuery工作正常。)
Example.com/example.com
Example.com/example.com?brand=x
change_brand: function () {
const vm = this;
/*** selected_brands = [] is an array defined in data ***
我已经实现了vue-i18n的本地化。
我的main.js
import Vue from 'vue'
import { i18n } from './plugins/i18n'
import Cookie from "vue-cookie";
if (!Cookie.get('locale')) {
Cookie.set('locale', 'en', 1)
}
new Vue({
el: '#app',
router,
i18n,
te
我有一个函数可以调用。 editTrade: function(tradeData) {
//include index and/or get object from store
//forward through router.
this.$router.push({name: '/trading/newTrade', params: {tradeData}}) 当我到达这个端点时,页面刷新,它显示/而不是预期的路由,并丢失所有数据,因此当我转到该路由时,它是空的。 地址栏具有正确的路由,但页面不正确。我已经看过文档了,如果你要发送参数,你应该使用
在我的nuxt应用程序中,在使用this.$router.push({ path: '/path' })改变路由后,我在火狐中获得了nodeOps.tagName(...) is undefined,在chrome中我得到了cannot get access to .toLowerCase() of undefined。
它发生在createPatchFunction of vue.runtime.esm.js版本:nuxt:^2.14.12, vue:^2.6.12中。
function createPatchFunction (backend) {
// ...
/