vuejs shows the brackets in the browser

1

Hello the problem is the following when I try to tenderizer information of the js to the html file to show it with vuejs it shows the brackets in the navigator as if it was not receiving information, I have vue installed global in npm

JS

    new Vue({
  el: '#app',
  data: {
    message: 'Hello world'
  }
});

HTML

<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <title>title</title>
  <link rel="stylesheet" href="index.css">
</head>

<body>
  <div id="app" v-cloak>
    <!--This markup will be the template of the root instance-->
    <h1>My Vue.js App</h1>
    <p >{{message}}</p>

  </div>
</body>

</html>
    
asked by liantony.p 23.11.2018 в 20:52
source

1 answer

1

Add the dependency of VUE and the dependency of the JS file where you are arming that shows the message

HTML

<!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8">
            <meta name="viewport" content="width=device-width">
            <title>JS Bin</title>
            </head>
    <body>
        <div id="app">
            {{ mensaje }}
        </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.3/vue.js"></script>
    <script src="vue.js"></script>
    </body>
    </html>

VUE.JS

const app = new Vue({
        el: '#app',
        data: {
        mensaje: "Hola Vue!"
    }
})

    
answered by 23.11.2018 / 20:55
source