Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't use Vue.config.delimiters, can only set delimiters on new Vue()

Tags:

vue.js

As per this answer, I'm trying to set Vue.config.delimiters = ['${', '}'] in order to use Vue with server-side handlebars.

When I just use the global config, it doesn't anything.

When I set delimiters on new Vues, it works

var game = new Vue({
        delimiters: ['${', '}'],
...

How can I make it work in one global place i.e. Vue.config.delimiter?

like image 987
ripper234 Avatar asked Jan 07 '17 16:01

ripper234


1 Answers

Global delimiters were removed in Vue 2, so you now have to set them on the Vue instance. From the Vue Github page:

...in 2.0 delimiters will become a component-level option, which means you only need to set it for the root instance that relies on in-DOM templates. Any components processed by vueify or vue-loader can just keep using default delimiters.

The change is intended to make it easier to use 3rd party components, since changing the delimiters globally means you will not be able to compile them correctly.

like image 91
craig_h Avatar answered Oct 06 '22 23:10

craig_h