Q
Q
quadabrashell2019-09-30 23:22:30
webpack
quadabrashell, 2019-09-30 23:22:30

How optimal is it to use Pug for the entire .vue file?

For example:

template
  p(align='right') Ура! Ни одного брекета или тега в файле

script(lang='coffee')
  export default
    props:
      document:
        type: Object
        required: true
    methods:
      // ...

style(lang='sass')
  p
    color: green

Better yet, configure the collector so that you do not write lang='sass'and'coffee'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Karimov, 2019-10-01
@quadabrashell

If you like "Python style" so much, then you should remember that Pug is an HTML templating engine. There is also coffee for similar syntax in javascript and sass (or stylus) for CSS.
As far as I understand, js, html, css is used by default in templating and this cannot be changed. But I advise you not to worry and always specify lang="pug", lang="coffee", lang="sass". Since you are writing a project and you understand and know everything, but if another programmer gets into your code, he will first burst his eyes from what he saw, then his brains will burst, since there is no explanation on what syntax it was written at all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question