Vue: Vue 2.5.1 Component custom delimiter not working

Created on 18 May 2017  路  4Comments  路  Source: vuejs/vue

Version

2.5.1

Reproduction link

Steps to reproduce

webpack.base.config has the following alias

      'vue$': 'vue/dist/vue.common.js',

Running vue 2.5.1, inside a component do

export default {
  delimiters: ['{', '}'],

And inside the <template> tags i have

        <div>
          <a class="logo">{ Model.Name }</a>
        </div>

What is expected?

Should output models value

What is actually happening?

outputting { Model.Name }

Most helpful comment

This is interesting to me. If you cannot change them in the .vue files you have inconsistency with applications that are harder to change. In Craft 3.0 I cannot see how to change the lexers globally. Even if I could find this it would likely break any Craft plugins that expect them to be the Twig default.

I think the same argument could be made for the other applications, there may be reasons there not to change the Lexers. I think allowing .vue components to change their own delimiters would make sense, however, I do agree with the argument that they should not be changed globally for a Vue application for the same reason. IMHO the best way to do it is to allow the developer to choose when to change them, even on a component that is in a .vue file.

All 4 comments

Delimiters can only be changed when using runtime compilation with the full build (vue.js). It does not work in *.vue files (to keep all *.vue files syntax consistent)

Also, there's no version 2.5.1 yet ;)

Oh okay! thanks! haha yeah i realized the 2.5.1 was for the cli :upside_down_face:

Also thanks for all your great work, i love vue!

[[ Thanks ]]

This is interesting to me. If you cannot change them in the .vue files you have inconsistency with applications that are harder to change. In Craft 3.0 I cannot see how to change the lexers globally. Even if I could find this it would likely break any Craft plugins that expect them to be the Twig default.

I think the same argument could be made for the other applications, there may be reasons there not to change the Lexers. I think allowing .vue components to change their own delimiters would make sense, however, I do agree with the argument that they should not be changed globally for a Vue application for the same reason. IMHO the best way to do it is to allow the developer to choose when to change them, even on a component that is in a .vue file.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gkiely picture gkiely  路  3Comments

bdedardel picture bdedardel  路  3Comments

bfis picture bfis  路  3Comments

6pm picture 6pm  路  3Comments

aviggngyv picture aviggngyv  路  3Comments