如何使用Vue同时显示不同的前端路由器视图

时间:2019-06-17 04:09:45

标签: javascript vue.js vuejs2 vuex vue-router

我有一个页面,该页面中有三个iframe(我必须使用iframe),它们将同时显示。在这些iframe中,我设置了指定的网址来自SPA页面。例如:

  routes: [
    {
      path: '/',
      name: 'air',
      component: () => import('@/views/dashboard/index.vue'),
      children: [
        {
          path: '/top',
          name: 'airTop',
          component: () => import('@/views/dashboard/top.vue')
        },
        {
          path: '/left',
          name: 'airLeft',
          component: () => import('@/views/dashboard/left.vue')
        },
        {
          path: '/right',
          name: 'airRight',
          component: () => import('@/views/dashboard/right.vue')
        }
      ]
    }
  ]

enter image description here
当我更改顶部iframe中的某些值时,我发现左侧的iframe不会更改。我意识到不同的iframe将获得一个新的Vue实例,因此该值将不会被共享。
我的问题:是否可以同时共享不同iframe中的值?使用sington吗?

0 个答案:

没有答案