Skip to content

Wrapping main component #1022

Dec 24, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

I'm not sure if you need to wrap the entire app in an n-message-provider, seems like you could as well just wrap it in your page components, so your page would look something like:

<template>
  <n-message-provider>
    <div>
      <!-- Your page content -->
    </div>
  </n-message-provider>
</template>

Perhaps you could even do that in a layout component

If you want to wrap the App component, maybe you could try to initialize your app by rendering your component as a parent, something ike this:

import { NMessageProvider } from 'naive-ui'

createInertiaApp({
  resolve: name => require(`./Pages/${name}`),
  setup({ el, App, props, plugin }) {
    createApp({
        render: () => h(NMessag…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ilyosjon09
Comment options

Answer selected by ilyosjon09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants