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

Error compiling template if using unicode naming as v-for alias #6971

Closed
nobodxbodon opened this issue Oct 31, 2017 · 1 comment
Closed

Error compiling template if using unicode naming as v-for alias #6971

nobodxbodon opened this issue Oct 31, 2017 · 1 comment

Comments

@nobodxbodon
Copy link

Version

2.5.2

Reproduction link

http://jsfiddle.net/bubq0ppd/

Steps to reproduce

Running the jsfiddle instance should make the warning appear in the console.

Just in case, here's the html and js code:

<script src="https://unpkg.com/vue"></script>
    <div id="元素id4">
      <ol>
        <li v-for="任务 in 任务表">
          {{ 任务.内容 }}
        </li>
      </ol>
    </div>
var 应用4 = new Vue({
  el: '#元素id4',
  data: {
    任务表: [
      { 内容: '学习 JavaScript' },
      { 内容: '学习 Vue' },
      { 内容: '整个牛项目' }
    ]
  }
})

What is expected?

IMHO, as the elements still displays in spite of the warning, this warning should not appear.

What is actually happening?

It seems to be caused by the regex for identifier validation here:
https://github.com/vuejs/vue/blob/dev/packages/vue-template-compiler/build.js#L3870

But I'm not sure why it only happens to alias instead of the iterator ("todo in 任务表" doesn't complain)


This issue is just noticed when I'm try to use Chinese naming as much as possible in sample codes in official guide: https://github.com/program-in-chinese/vuejs_guide_zh

Thanks for your time.

@nobodxbodon
Copy link
Author

Thank you~

lovelope pushed a commit to lovelope/vue that referenced this issue Feb 1, 2018
f2009 pushed a commit to f2009/vue that referenced this issue Jan 25, 2019
aJean pushed a commit to aJean/vue that referenced this issue Aug 19, 2020
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

2 participants