-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Why does vue init remove {{mydata}} from my template fork? #284
Comments
Because we use handlebars to parse all files and change the content according to the user's choices during template init, and the handlebars parser uses You can make handlebars skip your Vue-related braces by prepending a backslash, like we did here I the original template's Hello.vue component: https://github.com/vuejs-templates/webpack/blob/master/template/src/components/Hello.vue#L3 |
Thanks! |
@LinusBorg maybe I've got this wrong.. does this mean I have to prepend ALL vue |
Pretty much, unless you don't have to use vue-cli's
Well, it was a design decision back in the early days to use handlebars, which use
That would require to add an option in vue-cli to customize the handlebars delimiters - unfortunately, that it not that easy as handlebars itself doesn't support that. So we would have to find a replacement for handlebars that allows to change delimters while being backwards-compatible for existing templates using handlebars. You can open a feature request for this and we'll see how to solve this. |
@LinusBorg Thanks for the explanation, seems there's no easy solution indeed. In my scenario the template would already consist of quite a bit of base functionality (an IoT basic app with all the underlying basics like connection, communication, log and its views). The vue-cli template feature would be perfect for this case, if I could get around the handlebars collision problem. |
our member egoist has made a tool similar to vue-cli, but also a bit more flexible, and it's using EJS instead of handlebars ( https://github.com/egoist/sao That would mean your users have to install another CLI tool, but it works very similar and would get your going. |
Thanks a lot @LinusBorg, SAO indeed solves my immediate problem. Already created #546 though, feel free to close it (though the change still might be considerable given the probs it would solve :-). |
I created a fork of the webpack-simple template.
In this template I defined the following vue single file component:
page1.vue
As you can see, I have bound the string "works" to
{{mydata}}
.However, if I download the template via vue cli like this...
vue init valnub/vue-framework7-webpack-template temptest cd temptest npm install npm run dev
... then the following line:
| Data-binding {{mydata}}!
has changed to this:
| Data-binding !
What's going on? How is it possible, that {{mydata}} exists in the template but after using vue cli it's gone?
The text was updated successfully, but these errors were encountered: