Vue没有定义 [英] Vue is not defined

查看:183
本文介绍了Vue没有定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试用Vue.js构建一个演示应用程序。

I am trying to build a demo app with Vue.js. What I am getting is an odd error that Vue is not defined.

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue JS Intro</title>
</head>
<body>
    <div id="demo">
        <p>{{message}}</p>
        <input v-model="message">
    </div>

    <script type="JavaScript" src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.18/vue.min.js"></script>

    <script>
        var demo = new Vue({
            el: '#demo',
            data: {
                message: 'Hello Vue.js!'
            }
        })
    </script>
</body>
</html>

我在这里错过了什么?这不是CDN问题,因为我也从官方网站下载了库,使用它并得到了相同的结果。

What did I miss here? This is not a CDN issue as I also downloaded the library from the official website, used it and got the same result


index.html: 15 Uncaught ReferenceError:Vue未定义

index.html:15 Uncaught ReferenceError: Vue is not defined


推荐答案

href =http://jsbin.com/qutoco/edit?html,css,console,output =noreferrer> jsBin演示


  1. 您错过了订单,首先去
  1. You missed the order, first goes



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

<script>
    var demo = new Vue({
        el: '#demo',
        data: {
            message: 'Hello Vue.js!'
        }
    });
</script>




  1. type = JavaScript应该是 type =text / javascript(或者完全没有)

  1. and type="JavaScript" should be type="text/javascript" (or rather nothing at all)

这篇关于Vue没有定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆