[Vuejs]-Can you pass router-view as a prop in vuejs

0👍

With Vue 3 and Router 4, you can do something like

<router-view v-slot="{ Component }">
  <SomeComponent>
    <component :is="Component" />
  </SomeComponent>
</router-view>

and then

//SomeComponent.js
<template>
 <div class="wrapper">
  <slot></slot>
 </div>
</template>

here is an example with transition component as a wrapper for the router-view component

to know more about scoped slots you can see this

Leave a comment