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

Advertisements

3 comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s