# d7c-vue3-ts **Repository Path**: d7c/d7c-vue3-ts ## Basic Information - **Project Name**: d7c-vue3-ts - **Description**: 使用 vue-cli 脚手架初始化一个构建于 webpack 和 webpack-dev-server 之上的 Vue CLI3 版本的 Vue 项目。 - **Primary Language**: NodeJS - **License**: AGPL-3.0 - **Default Branch**: master - **Homepage**: http://www.d7c.top/ - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-12-08 - **Last Updated**: 2022-12-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # d7c-vue3-ts ## 介绍 使用 vue-cli 脚手架初始化一个构建于 webpack 和 webpack-dev-server 之上的 Vue CLI3 版本的 Vue 项目。 ## 软件架构 ### 应用程序依赖包管理工具 npm npm 官网地址:[https://www.npmjs.com](https://www.npmjs.com/),npm 全称 Node Package Manager 是 node 应用程序依赖包的管理工具,包括安装、卸载、更新模块操作,使用 nodejs 开发时一般使用 npm 来管理 nodejs 中的包。 ### 构建用户界面的渐进式 JavaScript 框架 vuejs vue3 中文官网地址:[https://v3.cn.vuejs.org/](https://v3.cn.vuejs.org/),vuejs github 地址:[https://github.com/vuejs/core](https://github.com/vuejs/core),vue 官方扩展工具地址:[https://github.com/vuejs](https://github.com/vuejs),vue 官方论坛地址:[https://forum.vuejs.org/](https://forum.vuejs.org/),[开发文档](https://v3.cn.vuejs.org/guide/introduction.html)。 ## 安装教程 ### 1. 在码云上创建 d7c-vue3-ts 仓库并克隆到本地 ### 2. 安装全局 vue-cli ``` npm install @vue/cli@4.5.18 -g ``` ### 3. 在本地仓库的上级目录使用 webpack 模板初始化该项目 ``` vue create d7c-vue3-ts ``` ``` 或者使用 vue ui 图形化界面初始化项目 ``` ### 5. 运行测试 ``` cd d7c-vue3-ts npm run serve ``` ### 6. 开启运行后自动打开浏览器选项配置 ``` ./package.json > scripts > serve > --open ``` ### 7. 解决 npm run build 后运行编译项目浏览器上不显示,F12 查看错误信息为 Uncaught SyntaxError: Unexpected token '<' ``` 增加 vue.config.js 文件 "publicPath: process.env.NODE_ENV === 'production' ? './' : '/'" 配置 ``` ## 使用说明 ### Project setup ``` npm install ``` ### Compiles and hot-reloads for development ``` npm run serve ``` ### Compiles and minifies for production ``` npm run build ``` ### Lints and fixes files ``` npm run lint ``` ### Export the configuration ``` vue inspect --mode=development > webpack.dev.js ``` ### Customize configuration See [Configuration Reference](https://cli.vuejs.org/config/). ### vue-cli-service serve [options] [entry] ``` vue-cli-service serve 命令会启动一个开发服务器 (基于 webpack-dev-server) 并附带开箱即用的模块热重载 (Hot-Module-Replacement)。 选项: --open 在服务器启动时打开浏览器 --copy 在服务器启动时将 URL 复制到剪切版 --mode 指定环境模式 (默认值:development) --host 指定 host (默认值:0.0.0.0) --port 指定 port (默认值:8080) --https 使用 https (默认值:false) 命令行参数 [entry] 将被指定为唯一入口 (默认值:src/main.js,TypeScript 项目则为 src/main.ts),而非额外的追加入口。 尝试使用 [entry] 覆盖 config.pages 中的 entry 将可能引发错误。 ``` ### vue-cli-service build [options] [entry|pattern] ``` vue-cli-service build 会在 dist/ 目录产生一个可用于生产环境的包,带有 JS/CSS/HTML 的压缩,和为更好的缓存而做的自动的 vendor chunk splitting。 它的 chunk manifest 会内联在 HTML 里。 选项: --mode 指定环境模式 (默认值:production) --dest 指定输出目录 (默认值:dist) --modern 面向现代浏览器带自动回退地构建应用 --target app | lib | wc | wc-async (默认值:app) --name 库或 Web Components 模式下的名字 (默认值:package.json 中的 "name" 字段或入口文件名) --no-clean 在构建项目之前不清除目标目录的内容 --report 生成 report.html 以帮助分析包内容 --report-json 生成 report.json 以帮助分析包内容 --watch 监听文件变化 这里还有一些有用的命令参数: --modern 使用现代模式构建应用,为现代浏览器交付原生支持的 ES2015 代码,并生成一个兼容老浏览器的包用来自动回退。 --target 允许你将项目中的任何组件以一个库或 Web Components 组件的方式进行构建。更多细节请查阅构建目标。 --report 和 --report-json 会根据构建统计生成报告,它会帮助你分析包中包含的模块们的大小。 ``` ## 运行展示 ![首页](https://images.gitee.com/uploads/images/2021/0609/120923_485e5364_1070311.png "QQ图片20210609120743.png") ## 捐助打赏 如果您觉得我们的开源软件对你有所帮助,请扫下方二维码打赏我们一杯咖啡。 ![微信收款码](https://images.gitee.com/uploads/images/2021/0222/174352_b22739f5_1070311.jpeg "微信收款码.jpg") ![微信赞赏码](https://images.gitee.com/uploads/images/2021/0222/174521_67e18b39_1070311.jpeg "微信赞赏码.jpg") ![支付宝收款码](https://images.gitee.com/uploads/images/2021/0222/174540_94a9ac41_1070311.jpeg "支付宝收款码.jpg") ## 参与贡献 1. Fork 本仓库 2. 新建 d7c-vue3-ts_xxx 分支 3. 提交代码 4. 新建 Pull Request ## 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)