Change Vue.js Default Template Tags

As a Django developer I get used to use tag “{{” and “}}” in my template, but when I’m trying to use Vue.js in my project I have to change Vue’s default tags, because Django template and Vue.js has the same tags “{{” and “}}” for binding variable data in html template.

Here is how to change default Vue.js tags

Vue.config.delimiters = ["[[", "]]"];

Now you can using “[[” and “]]” as your Vue.js tags in your project.
FYI you can replace with wathever you want for Vue tags delimiter, but I get used to use double square braces. 😀

Reference: http://stackoverflow.com/a/33628663/1936697

3 responses to “Change Vue.js Default Template Tags”

  1. I just want to say thank you 🙂

    Like

  2. […] But there is a nicer way to do this by just changing the configuration in vue to use the square brackets instead of braces […]

    Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.