Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Allowing Vue.config.delimiters/unsafeDelimiters for the CLI #100

Closed
zargold opened this issue May 18, 2016 · 11 comments
Closed

Comments

@zargold
Copy link

zargold commented May 18, 2016

Hi I am using django and I'm sure others have other reasons as well for needing to use different configuration for the delimiters. If there was a way to customize the template will automatically generate the markup with '[[' ']]' instead of {{ }} I'd really appreciate it.

@yyx990803
Copy link
Member

Hmm, this is interesting because 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.

So in the long run, delimiters will have a very narrow use scope and this feature would be unnecessary.

@LinusBorg
Copy link
Member

Well, there's only one line in the templates that actually uses the delimiters (Line 3 in Hello.vue).

Therefore, I think adding the ability to change delimiters in the template init process would not have a big enough benefit to put in the work to add this feature, in my opinion.

@chrisvfritz
Copy link
Contributor

I agree. Making the 99% of people who don't need custom delimiters make a choice about a feature they may not even know exists probably isn't worth saving 2 minutes for possibly less than 1% of people.

@dragorwyin
Copy link

dragorwyin commented Apr 3, 2017

So, one percent which uses for example Hugo (golang) as template system will not be able to use in easy way Vue 2.0? Very, very bad :/ I'm one of that person and my friends also too :/
If you know that problem, golang template system uses {{ }} delimeters too in templates, so it's conflicted :/

@zargold
Copy link
Author

zargold commented Apr 3, 2017

Hi @dragorwyin you could still use vue.js even without this: vue.js itself allows you to do so, but this is for Vue-Cli which allows you to build Vue components with an easy bash command... anyway soon it will be released probably. Also, you can probably use something like {block of Non template script }
{end block} in most templating server languages.

@dragorwyin
Copy link

Hi @zargold. Thanks for info. For now, i'm using delimiters parameter on every vue component and it works also too. :) Nice, that there is possibility to change it by myself.
For those who don't know how take a short example:

let vm = new Vue({
	el: '#example',
	delimiters: ['${', '}'],
	data: {
		message: "hi there :)"
	}
});

So, now everything inside div and between ${ } delimeters will works also too :)
I don't know how many people has the same problem, but I will leave that for future :)

@posva
Copy link
Member

posva commented Apr 5, 2017

Chris made a very good point and it looks like we're all against it so I'll close this.

@posva posva closed this as completed Apr 5, 2017
@JohnRobson
Copy link

Ok, but how to use Vue together with frameworks that use jinja? {{ x }}

@pipinet
Copy link

pipinet commented Dec 6, 2018

Ok, but how to use Vue together with frameworks that use jinja? {{ x }}

{% raw %}{{ xxxx }}{% endraw %}

@d0p3fish
Copy link

d0p3fish commented Jun 7, 2020

How to use it with twig {{ }} ?
Cant get it working.

@WhereJuly
Copy link

WhereJuly commented Dec 24, 2020

Why one would ever use delimiters in Vue while it allows for v-bind kind of syntax? Use v-text="myvalue", v-html="...html here" ? Or render your non-.vue templates with {{ }} delimiters into HTML before passing them to Vue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests