[Vuejs]-How to apply other components to one path of Vue Router

0👍

Vue-router only allows one component per route. This is the main reason for your code to not work as intended.

A possible solution is to have a functional component to nest this logic:

export default {
  functional: true,
  render(h) {
    return isMobile 
    ? h('MobileSomeComponent')
    : h('DesktopSomeComponent')
  }
}
👤a–m

Leave a comment