Why are my Vue instance's properties and methods not available in the template?

前端 未结 1 520
余生分开走
余生分开走 2021-01-24 18:32
  • I set up a Vue.js CLI project.
  • On a page, I want to define a variable in data() and then use it in my template.
  • Why does the following code
相关标签:
1条回答
  • 2021-01-24 18:55

    You need to add <script> tags around the javascript for your Page1 and Page2 components.

    Otherwise, it seems like vue-loader just ignores that script and doesn't give you a relevant warning (just that the data being referenced in your template is missing).

    0 讨论(0)
提交回复
热议问题