N
N
Novamoscow2019-03-15 17:41:48
Pug
Novamoscow, 2019-03-15 17:41:48

How to use pug inside vue component?

The entire project is written in pug. I use this construction inside .pug files

<tamplate lang="pug">
   .is__title.connect__title 
     button-counter

Everything is working.
Then I decided to transfer part of the layout to the child vue component in order to display it dynamically.
template: `
      <tamplate lang="pug"> 
        span {{ tr(lang).title }} 
      </tamplate>`

I tried to display the layout in the component in the same way, it didn’t work out, I don’t really want to rewrite it in html, how to implement it correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2019-03-15
@Novamoscow

https://pugjs.org/api/reference.html
Connect pug and it should work like this:

import pug from 'pug';

//...
template: pug.render(`span {{ tr(lang).title }} `)

But I would not crutch))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question