Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

189
Views
VueJS doesn't recognize my variable between curly braces

I'm moving my very first steps into VueJS but I'm already stuck. I'm simply trying to display a variable, but even if the syntax look correct to me, I get

{{product}}

displayed instead of the actual product name. Here's the HTML:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Vue Mastery</title>
    <!-- Import Styles -->
    <link rel="stylesheet" href="./assets/styles.css" />
    <!-- Import Vue.js -->
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
  </head>
  <body>
    <div id="app">
      <h1>{{product}}</h1>
    </div>

    <!-- Import App -->
    <script src="./main.js"></script>
    <!-- Mount App -->
    <script>
      const mountedApp = app.mount("#app");
    </script>
  </body>
</html>

And here's the JS:

const app = Vue.createApp({
  data() {
    return {
      product: "socks",
    };
  },
});

Thank you!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You should use the CDN of version 3 since the syntax of Vue 3 :

<script src="https://unpkg.com/vue@3"></script>

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <title>Vue Mastery</title>
  <!-- Import Styles -->
  <link rel="stylesheet" href="./assets/styles.css" />
  <!-- Import Vue.js -->
 <script src="https://unpkg.com/vue@3"></script>
</head>

<body>
  <div id="app">
    <h1>{{product}}</h1>
  </div>

  <!-- Import App -->
  <script>
    const app = Vue.createApp({
      data() {
        return {
          product: "socks",
        };
      },
    });
  </script>
  <!-- Mount App -->
  <script>
    const mountedApp = app.mount("#app");
  </script>
</body>

</html>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!