DEV Community

Alexis Bohns
Alexis Bohns

Posted on

Is there an equivalent to SLIM in Vue.js?


I used to work as front integrator on ruby apps. Using .slim was a revelation, saving lot of time, avoiding the boring and useless HTML closing tags, improving readability...

I'm going to work on a Vue.js based framework (Nuxt, Gatsby or Gridsome, it will depend on the need of complex features).

However, my team and me are absolutely unable to find and config any HTML preprocessor that works like SLIM for Vue.js templates.

Any of you has an idea or a suggestion?

Many thanks for your help and sory for my bad English :angel


Top comments (2)

tqbit profile image

Hey Alex,

if you're only in need of static content, a markdown compiler could do the trick. Nuxt supports Nuxt Content, while other frameworks, such as Vuepress (or Vitepress) and Gatsby have this baked in.

If you're looking to write components this way, I'm afraid you will have to stick with the standard approach. As far as I know, there's no pre-processor that's able to extract vue-bindings from HTML shorthand syntax, such as Pug or Jade.

If you find one, I'd be curious to see it though, please do put it into this conversation :)

puzzleitnu profile image

You can use lang='pug' in the template part of a SFC. Don't think there is a slim pre-processor for vite/vue-cli.