[Vue warn]: Cannot find element: #app
转自:https://blog.csdn.net/linyeban/article/details/54629869
学习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>
[Vue warn]: Cannot find element: #app的更多相关文章
- Vue报错 [Vue warn]: Cannot find element
		在前端开发全面进入前端的时代 作为一个合格的前端开发工作者 框架是不可或缺的Vue React Anguar 作为前端小白,追随大佬的脚步来到来到博客园,更新现在正在学习的Vue 注 : 相信学习Vu ... 
- vue报错[Vue warn]: Unknown custom element: <router-Link> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
		vue浏览器报错,如下 vue.runtime.esm.js?2b0e:619 [Vue warn]: Unknown custom element: <router-Link> - di ... 
- [Vue warn]: Unknown custom element: <sapn> - did you register the component correctly? For recursive components, make sure to provide the "name" option.  found in  ---> <Evaluate> at src/views/index/
		关于vue报错: [Vue warn]: Unknown custom element: <sapn> - did you register the component correctly ... 
- Vue报错之" [Vue warn]: Unknown custom element: <wzwzihello> - did you register the component correctly? For recursive components, make sure to provide the "name" option."
		一.报错截图 [Vue warn]: Unknown custom element: <wzwzihello> - did you register the component corre ... 
- [Vue warn]: Cannot find element: #main
		使用vue框架的时候,如果页面提示如下错误,则说明new Vue的时候没有传入 el 的值: [Vue warn]: Cannot find element: #main 我们传入el 既可以,如: ... 
- [Vue warn]: Unknown custom element: <terminal-process> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
		Vue组件注册报错问题 import 不要加{},排查出如果页面引用单个组件的时候不要加上{}中括号,引入多个组件时才能派上用场,中括号去除问题即可解决. 
- vue components registration & vue error & Unknown custom element
		vue components registration & vue error & Unknown custom element vue.esm.js:629 [Vue warn]: ... 
- [Vue warn]: Error in render: "TypeError: Cannot read property '0' of undefined、vuejs路由使用的问题Error in render function
		1.[Vue warn]: Error in render: "TypeError: Cannot read property '0' of undefined 注意,只要出现Error i ... 
- "[Vue warn]: Failed to mount component: template or render function not defined"错误的解决
		VUE中动态路由出错: vue.esm.js?a026: [Vue warn]: Failed to mount component: template or render function not ... 
随机推荐
- flynn 开源paas 平台安装试用
			flynn 是一个不错的开源paas 平台,基于git 以及容器技术,开发模型与 heroku 基本一样,同时构建方式就是基于heroku 的buildpacks 安装 官方文档提示说明是ubuntu ... 
- VisualSVN安装配置与使用
			VisualSVN安装配置与使用 1. 所选服务器安装包:VisualSVN-Server-2.1.3.msi. 2. 客户端安装包:TortoiseSVN-1.6.2.16344-win32-s ... 
- Git中特别的命令
			Rebase 假设我们的分支结构如下: rebase 会把从 Merge Base 以来的所有提交,以补丁的形式一个一个重新达到目标分支上.这使得目标分支合并该分支的时候会直接 Fast Forwar ... 
- meta viewport 理解
			移动设备上的浏览器如果不指明 viewport 这个meta,当你从移动设备上浏览网页的时候,它假设(你浏览的是桌面版并且你想看到所有的内容),不只是一个左上角.因此,它会把viewport的宽度设置 ... 
- XFire构建web service客户端的五种方式
			这里并未涉及到JSR 181 Annotations 的相关应用,具体的三种方式如下 ① 通过WSDL地址来创建动态客户端 ② 通过服务端提供的接口来创建客户端 ③ 使用Ant通过WSDL文件来生成客 ... 
- Angular 4 绑定
			一.事件绑定 1. 创建doOnClick函数 2. 网页中绑定doOnClick方法 3. 效果图 二. 属性绑定 1. 定义imgUrl的网址 2. 定义img src属性 另外一种写法 3. ... 
- Oracle RAC的机制与测试方法
			Oracle RAC的机制与测试方法 标签: rac 机制 测试 2016-05-25 09:54 1150人阅读 评论(0) 收藏 举报 分类: oracle(2) 1.RAC原理 Oracle ... 
- Oracle 11G 单机asm安装
			http://sugarlovecxq.blog.51cto.com/6707742/1702092/ 
- 异步FIFO格雷码与空满
			在传递读写时钟域的指针使用格雷码来传递,如何把二进制转换为格雷码,格雷码是如何判断读空写满呢? 二进制码转换成二进制格雷码,其法则是保留二进制码的最高位作为格雷码的最高位,而次高位格雷码为二进制码的高 ... 
- Celery 异步定时周期任务
			1/什么是Celery Celery 是基于Python实现的模块,用于执行异步定时周期任务的 其结构的组成是由 1.用户任务app 2.管道 broker 用于存储任务 官方推荐 redis rab ... 
