0
votes

I'm using netbeans as an editor and trying to work my way through the laracast vue videos including https://laracasts.com/series/learning-vue-step-by-step/episodes/1

<script> src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.12/vue.js"</script>

<div id="app">  
    <h1> 
        {{message}}             
    </h1>
</div>
var data = {message: "hi there"}

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

when I check chrome dev tools I see:

Uncaught ReferenceError: Vue is not defined

Am I doing something wrong with the CDN?

2
yeah, you need to do it like this <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.12/vue.js"></script> .... You closed the script tag too earlyPaul Fitzgerald

2 Answers

7
votes

src is attribute of script tag, so:

<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.12/vue.js"></script>
0
votes

Please note that while using Vue with laravel blade files. You had to save those Vue code in a separate file with vue extension and then add them in blade files. as indicate here. Otherwise I believe both will try to interpret double mustache and to cater that you had to rewrite a lot of either lib.