编译代码很简单

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Title</title><script src="vue.js"></script><!--<script src="https://cdn.bootcss.com/vue/2.6.10/vue.js"></script>--><!--<script src="http://static.runoob.com/assets/vue/1.0.11/vue.min.js"></script>--><script>new Vue({el:'#app',data: {message:'Hello World!'}});</script>
</head>
<body>
<div id="app"><h2>{{message}}</h2>

</div>

</body>
</html>

一直以为是引入的vue.js有问题换了好多,然后又配置npm

原来是手写的vue.js要在最后引入

因为要先有id为vue-app的div,vue才能获取相应的元素。

更改后:

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Title</title><script src="vue.js"></script><!--<script src="https://cdn.bootcss.com/vue/2.6.10/vue.js"></script>--><!--<script src="http://static.runoob.com/assets/vue/1.0.11/vue.min.js"></script>-->

</head>
<body>
<div id=“app”>
<h2>{{message}}</h2>

</div>

<script>
new Vue({
el:’#app’,
data: {
message:‘Hello World!’
}
});
</script>

</body>
</html>

vue.js在官网下载即可:https://cn.vuejs.org/v2/guide/installation.html

vue报错:vue.js:634 [Vue warn]: Cannot find element: #app相关推荐

  1. Vue报错:conflicts with v-model on the same element because the latter already expands to a value

    Vue报错:conflicts with v-model on the same element because the latter already expands to a value :valu ...

  2. vue.js报错 vue.js:597 [Vue warn]: Cannot find element: #app

    刚开始使用vue的时候发现vue报vue.js:597 [Vue warn]: Cannot find element: #app的错误,初始以为是写的代码有错误导致,于是认真的对照了几遍发现代码和官 ...

  3. Vue报错:sockjs.js?9be2:1627 GET http://192.168.43.88:8080/sockjs-node/info?t=1631603986586 net::ERR_CO

    Vue报错:sockjs.js?9be2:1627 GET http://192.168.43.88:8080/sockjs-node/info?t=1631603986586 net::ERR_CO ...

  4. 解决Vue报错:[Vue warn]: Error in nextTick: “NotFoundError: Failed to execute ‘insertBefore‘ on ‘Node‘: T

    解决Vue报错:[Vue warn]: Error in nextTick: "NotFoundError: Failed to execute 'insertBefore' on 'Nod ...

  5. vue.js:634 [Vue warn]: Failed to resolve directive: moble

    vue报错 原因是在v-model中的单词拼写错误,有时候不小心点到替换啥的,看起来差不多,仔细看才会发现,记录一下

  6. Vue报错记录——无法找到app

    报错信息: [Vue warn]: Cannot find element: #app 原因是:我把相关的js文件放在head里面,导致文件未加载完成就运行js文件,所以js找不到 #app . 改正 ...

  7. Vue报错:Error in v-on handler: “TypeError: Cannot read properties of undefined (reading ‘skuId‘)“

    背景: 当点击按钮时候,正常情况控制台的Network应该要发送一个变化量,现在控制台的Network不仅不显示,而且还报错,报错信息如下: vue.runtime.esm.js?c320:619 [ ...

  8. Vue报错:3 errors and 0 warnings potentially fixable with the `--fix` option.

    Vue报错:3 errors and 0 warnings potentially fixable with the --fix option. 报错如下 解决办法 注释掉.eslintrc.js文件 ...

  9. Vue报错Module build failed Error Node Sass version 6.0.1 is incompatible with ^4.0.0.解决方案

    Vue报错Module build failed: Error: Node Sass version 6.0.1 is incompatible with ^4.0.0.解决方案 错误提示: ERRO ...

  10. VUE报错:Avoid mutating a prop directly since the value will be overwwritten whenever the parent及解决方案

    VUE报错: [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the p ...

最新文章

  1. hdu 5108(分解质因数)
  2. java单终端登陆_配置终端服务单一登录
  3. magento:getChildHtml() 与getChildChildHtml() 的用法,区别
  4. 弄了一个数学论坛,感觉不错,欢迎加入讨论
  5. 蓝桥杯 ALGO-77 算法训练 斜率计算
  6. 火爆的文字游戏你玩了吗?「GitHub 热点速览 v.22.06」
  7. 物联网从业者必须知道的知识:IMSI号介绍与解析
  8. 河南理工计算机课程表,河南理工大学张威的课程表.doc
  9. 关于eWebEditor-在线HTML编辑器控…
  10. python 键盘输入立刻反应_win10系统,为什么键盘输入字符后得停顿一下,鼠标点击才有效 例如在wor...
  11. Jumserver安装日志审计和资产管理
  12. python分词考研英语真题词频(附结果)——读取word、nltk、有道智云API
  13. php发送邮件email
  14. AndroidStudio安装JB系官方中文插件
  15. python 打印日历
  16. install developing enviroment
  17. Windows10启动Docker报错:Hardware assisted virtualization and data execution protection must enabled BIOS
  18. 腾讯云TDSQL数据库信创演进与实践
  19. 旅游类产品——“马蜂窝自由行”交互原型模板免费使用
  20. 【信奥赛一本通】1184:明明的随机数(详细代码)

热门文章

  1. linux dd if提示是目录,Linux dd 命令详解
  2. 打官司除了找律师,还能找谁?
  3. linux磁盘转gpt,Linux中磁盘如何转换GPT格式
  4. 浅浅分析滤波器截止频率
  5. 趋势 |「酸性设计」到底有多酷?
  6. JPBC部分API说明
  7. android ar 动画,Android实现支付宝AR扫描动画效果
  8. 2020鸿蒙系统pc版,华为将在2020年发布鸿蒙操作系统2.0版,应用于创新国产PC电脑...
  9. Larval Blade
  10. 数组排序之冒泡法和选择法