Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a better way to make transformVT apply globally? #238

Open
wujiesixing opened this issue Jul 18, 2024 · 1 comment
Open

Is there a better way to make transformVT apply globally? #238

wujiesixing opened this issue Jul 18, 2024 · 1 comment
Labels
feature Includes new features 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing

Comments

@wujiesixing
Copy link

  const App = defineComponent({
    components: { Comp1, Comp2 },
    ssrRender: compileWithCustomDirective(
      `
      <div v-t="{ path: 'hello' }"/>
      <Comp1 />
      <Comp2 />`,
      transformVT
    )
  })

  const app = createSSRApp(App)
  app.use(i18n)
  await renderToString(app)

To apply the transformVT function to components Comp1 and Comp2, is it necessary to override ssrRender in both Comp1 and Comp2? Is there a better way to make transformVT apply globally?

@kazupon kazupon added feature Includes new features 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing labels Jul 20, 2024
@kazupon
Copy link
Member

kazupon commented Jul 20, 2024

We might provide transformVT could have an option to make it available in global scope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Includes new features 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing
Projects
None yet
Development

No branches or pull requests

2 participants