Skip to content

Nowhere is mentioned what the syntax is for calling child components? #161

Closed Answered by ShenQingchuan
ivanjeremic asked this question in Q&A
Discussion options

You must be logged in to vote

No @ivanjeremic , please check what we mentioned in our docs: https://vue-vine.dev/specification/overview.html#template

Using expression interpolation in template is forbidden.

Because the whole tagged template string is a raw Vue template. Vine compiler will transfer it to @vue/compiler-dom to compile it to render function in the end.

The correct way to reference a child component it just the same as what you did in Vue SFC.

function A() {
  return vine`<p>hello from A</p>`
}

function B() {
  return vine`
    <div>hello from B</div>

    <!-- ↓ Using A as a Vue component tag here -->
    <A /> 
  `
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ShenQingchuan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants