<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>从零开始打造 todo 应用</title>
<!-- 此时该 index.html 文件就是主页文件 -->
</head>
<body>
<div id="app"></div>
<!-- <script src="./src/main.js"></script> -->
<!--此时导入 main.js 来测试能否成功加载并展示 App.vue 中的信息; -->
<!-- 此时页面显示为:Uncaught SyntaxError: Cannot use import statement outside a module(应该为:Uncaught SyntaxError: Unexpected Identifier)
表示页面是直接不能识别这个 index.html 文件中的 main.js 中的 import 这些东西,需要 webpack 去打包等解析;
-->
<!-- 使用 webpack 工具之后,只能解析默认的 .js 文件,但需要安装 vue-loader 去解析 .vue 文件; -->
<!-- <script src="./dist/bundle.js"></script> -->
<!-- <script src="./bundle.js"></script> -->
<!-- 注意:若使用 html-webpack-plugin 插件,那么在根目录下的 index.html 文件中是不需要引入出口文件的(如:bundle.js,因为在 dist 打包中自己会加入) -->
<!-- 此时页面显示为:You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions,
or use the compiler-included build. ,原因:是默认导出的 Vue 打包的文件为 vue.common.js,而需要再添加别名的配置将 Vue 打包的文件改为:vue.js(即:vue/dist/vue.js),
此时再加载 bundle.js 文件后,在浏览器上就能成功显示 App.vue 中的 <template/> 中的信息;
-->
<!-- 注意:再引入 bundle.js 文件之后,就不要再引入 main.js 文件,因为此时的 main.js 文件已经在 bundle.js 文件中解析好了; -->
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
若有想要学 Webpack 的,真的很值得下载这个资源: 其一、包括初始化安装 webpack 工具; 其二、安装 Vue 并挂载实例,浏览器能打开 index.html 文件; 其三、webpack 基本配置,成功打包 .js 文件; 其四、Webpack 使用 vue-loader 打包 vue 文件,浏览器成功打开 .js 和 .vue 文件; 其五、其它 loader的用法(如:打包图片、打包 CSS 文件、打包 stylus 文件); 其六、使用 html-webpack-plugin、clean-webpack-plugin 插件、 autoprefixer 插件; 其七、使用 devServer 配置、使用模块热替换、使用 SourceMap 配置; 其八、将环境分成开发环境、生成环境、公共部分; 其九、使用 babel 将 ES6 编译成 ES5 的语法(即:兼容 ES6 的语法); 其十、TodoList 项目组件拆分与设计项目的目录结构; 其十一、实现 MainHeader 组件、核心 MainTodo 组件、MainFooter 组件,明确需求与业务逻辑及项目小结
资源推荐
资源详情
资源评论
收起资源包目录
vue_todo.7z (38个子文件)
vue_todo
webpack.config测试1.js 9KB
.vscode
settings.json 1KB
src
App.vue 1KB
assets
styles
theme.styl 149B
text.css 134B
reset.css 78B
global.styl 917B
mixins.styl 680B
images
bg1.jpg 246KB
check1.svg 3KB
Checked.svg 364B
bg.jpg 8KB
bg4.jpg 146KB
uncheck1.svg 7KB
bg3.jpg 96KB
Checked12.svg 362B
Checked56.svg 362B
unChecked.svg 326B
main.js 1KB
components
MainFooter.vue 323B
MainTodo
MainTodo.vue 6KB
coms
TodoInfo.vue 3KB
TodoItem.vue 2KB
TodoInfo11.vue 2KB
MainHeader.vue 1KB
package测试.json 1KB
webpack.prod测试2.js 5KB
.babelrc 85B
dist
package.json 1KB
steps.md 72KB
build
webpack.base.js 5KB
webpack.dev.js 2KB
webpack.prod.js 840B
package-lock.json 479KB
webpack.dev测试2.js 9KB
index.html 2KB
postcss.config.js 915B
index1.html 2KB
共 38 条
- 1
资源评论
狮子座的男孩
- 粉丝: 3w+
- 资源: 15
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功