I
I
Illia T2019-06-17 06:23:49
JavaScript
Illia T, 2019-06-17 06:23:49

What is wrong with Vue.js?

<body>

  <div id="app">
    <h1> Hello {{name}}</h1>
    <h2><a v-bind:href="url-google">Google</a></h2>
  </div>

  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
  <script type="text/javascript">
    new Vue({
      el: '#app',
      data: {
        name: 'there',
        url-google: 'www.google.com'
      }
    })
  </script>

</body>

After adding the line h2 and url-google to the data field, the name value stopped pulling up (the variable itself is simply displayed), and the link itself is not a link. It's time for me to go to work, so it would be great if someone could tell me during the day so that I can save time and continue moving on in the evening :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
TCloud, 2019-06-17
@illiatovpeko

Answer.

...
        urlGoogle: 'www.google.com' // <- все до безобразия просто. Переменная неправильно названа.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question