[Vue warn]: Cannot find element: #app
来源:互联网 发布:能在mac上玩的网游 编辑:程序博客网 时间:2024/06/05 21:51
学习vue的时候,刚开始按照官网的例子敲写,却出现以下的问题:
问题:这是因为你的js在html页面头部引入的原因,自定义js文件要最后引入,因为要先有元素id,vue才能获取相应的元素
正确的的代码:
<!DOCTYPE html>
<htmllang="en"xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
<metacharset="UTF-8">
<title>nihao</title>
</head>
<body>
<divid="app">
{{ message }}
</div>
<scriptsrc="vue.js"></script>
<script src="index.js"></script><!--这里自定js文件要在最后引入。-->
</body>
</html>
1 1
- [Vue warn]: Cannot find element: #app
- vue.js报错 [Vue warn]: Cannot find element: #app
- vue.js:[Vue warn]: Cannot find element:
- 关于Cannot find element: #app 的解决方法
- tomcat启动提示cannot find the declaration of element 'web-app'
- Cannot find the declaration of element 'beans'
- Cannot find the declaration of element 'beans'
- Cannot find the declaration of element 'beans'
- Cannot find the declaration of element 'beans'
- [Vue warn]: Error compiling template Component template requires a root element, rather than just te
- Electron 发生错误 "Cannot find module app"
- Cannot find the declaration of element 'beans'. 的解决方法
- Cannot find the declaration of element 'beans'. 的解决方法
- Cannot find the declaration of element 'beans'. 的解决方法
- cvc-elt.1: Cannot find the declaration of element 'ehcache'.
- cvc-elt.1: Cannot find the declaration of element 'beans'.
- spring框架 错误:Cannot find the declaration of element 'beans'.
- cvc-elt.1: Cannot find the declaration of element 'MyElement'
- 块元素和内联元素精炼
- haproxy的日志配置
- 正向代理与反向代理的区别
- 操作系统精髓与设计原理-线程、对称多处理(SMP)和微内核
- 通过github上的项目理解HashMap
- [Vue warn]: Cannot find element: #app
- PAT 1097. Deduplication on a Linked List (25)
- MySQL 此例简单介绍基于docker的mysql安装与双主互备
- spring boot 知识点整理
- CSS3 Animation
- Mybatis-Mapper.xml输入输出映射
- Java的基本概念-三大循环
- Android源码编译
- keepalived vrrp 协议介绍