mardi 31 octobre 2017

vue js failed to "reactive"

i am following this tutorial http://ift.tt/2zSOXik. the page works fine without error on console but i cant change the message via console to showing "app2.message" and give me error "#app2 is not defined". its not working like they said

We have already created our very first Vue app! This looks pretty similar to rendering a string template, but Vue has done a lot of work under the hood. The data and the DOM are now linked, and everything is now reactive. How do we know? Open your browser’s JavaScript console (right now, on this page) and set app.message to a different value. You should see the rendered example above update accordingly.

enter image description here

here is my script:

window.addEventListener('load',
function() {

    var app2 = new Vue({
        el: '#app-2',
        data: {
            message: 'You loaded this page on ' + new Date().toLocaleString()
        }
    })

}, false);

this is how i include the js

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="">
<title>3R Inventory | @yield('title')</title>

<!-- Fonts -->
<link href="http://ift.tt/2dHeAcp" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="">
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
</head>



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2hpfZY5
via IFTTT

Aucun commentaire:

Enregistrer un commentaire