Skip to content

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

Open
@wujiesixing

Description

@wujiesixing
  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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIncludes new features🍰 p2-nice-to-havePriority 2: nothing is broken but it's worth addressing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions