Sign in
Log inSign up

VueJS: Changing placeholder handlebars

Coder Yeti's photo
Coder Yeti
·May 8, 2016

When using VueJS on an HTML page rendered by server, the old clashing handlebars came rearing its head.

Specifically, my python backend (bottle.py framework ) was spitting out rendered HTML using its built in template engine 'Simple Template Engine'. It uses {{ }} for delimiters on views.

This clashed with default delimiters used by VueJS.

An easy solution was to change delimiters - on VueJS (since it was the newer entrant to the stack) - to ${ }

It was achieved easily by the following single line of code:

Vue.config.delimiters = ['${', '}']

Note: laravel's blade templating engine has a neat solution to this problem - add '@' before the braces and laravel ignores it: like so @{{ }}

Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct