Slaus
Slaus

Reputation: 2236

"Mustache" syntax alternative for Vue template when using Pug language

"Mustache" syntax allows defining data like this:

<template>
    <Window>
        <template v-slot:title >
            {{title}}
        </template>
    </Window>
</template>

but compilation with lang='pug' fails:

<template lang='pug'>
    <Window>
        <template v-slot:title >
            {{title}}
        </template>
    </Window>
</template>

With this error:

Module build fails: unexpected text "{{" ...

Other templates without mustache syntax usage build fine with lang='pug'. What's the Pug's alternative to mustache syntax?

Upvotes: 0

Views: 864

Answers (1)

tony19
tony19

Reputation: 138536

Note that the contents of your Pug template isn't actually Pug syntax, but that aside:

In Pug, plaintext should be inside a tag (e.g., span) or prefixed with the pipe character:

<template lang="pug">
Window
  template(v-slot:title="")
    | {{title}}
</template>

demo

Upvotes: 1

Related Questions