Giter Club home page Giter Club logo

eatting's Introduction

eatting

工程安装 Project setup

为防止无法正常运行请执行(https://blog.csdn.net/mo_247/article/details/86259442)

1、删除 node_modules文件(如若存在)
2、删除package-lock.json文件(如若存在)
3、npm cache clean --force
4、npm init -f

修改package.json之后

npm install

开发前的编译 Compiles and hot-reloads for development

修改router配置和vue.config.js之后

npm run serve

上线前的编译 Compiles and minifies for production

形成文件

npm run build

安装的node版本过高

(1)降低node版本(也可安装版本管理器nvm)
①到官网查看node对应npm版本https://nodejs.org/zh-cn/download/releases/
②npm i -g [email protected]

(2)升级依赖版本
①删除package.json中的依赖再npm i
②进行npm run serve时会提醒缺少依赖xxx,
此时执行npm install xxx --save

其他

自动修复
npm run lint
查看当前配置
npm config list
更新版本
npm install -g npm

自定义配置参考 Customize configuration

See Configuration Reference.

——————————————————————————

项目结构

|——.npmrc           #npm配置
|——.eslintrc.js     #代码规范
|——.eslintignore    #忽略规范
|——.editorconfig    #代码风格(空格控制)
|——.browserslistrc  #浏览器兼容
|—— package.json    #依赖
|—— vue.config.js   #CLI 配置
|—— src    #开发主文件夹[@/]
|    |——assets      #资源
|    └──components  #组件
|	   |——http        #通用http请求
|	   |——router      #路由
|	   |——store       #vuex
|	   |——locales     #语言
|	   |——views       #页面 
|	   |——App.vue     #入口
|        └──main.js     #公共插件
└── public  #根目录[/][#/]
      └──index.html #首页,配置meta等

搭建项目

## 开始
vue create XXX
(存在单独配置文件时,记得把package.json对应配置删除)

## 依赖
vant                        #UI框架
compression-webpack-plugin  #打包使用
express                     #轻量web开发框架(用来获取json里的数据)(好像也可以用来获取mysql数据的)
better-scroll               #应该是用来做滚动的
## 依赖漏配置却使用到(根据错误提示写XXX)
npm install xxx --save

## 配置路径别名
在cli配置文件中配置

## 路由
公共导航栏
①写入app.vue
②通过meta判断是否加公共导航栏
https://blog.csdn.net/qq_37949984/article/details/91038387
登陆验证
https://blog.csdn.net/cofecode/article/details/79181894
重定向和404
https://www.cnblogs.com/goloving/p/9254084.html

## 注意
main.js中全局定义的路由和vuex等,在vue文件中使用时需要加$
[如$router,$store]

其他

git推送相关问题 提示用户名密码错误 https://blog.csdn.net/u013977285/article/details/79726354 不同的推送方式 https://www.cnblogs.com/cicaday/p/4953664.html

eatting's People

Contributors

xujaven avatar t131153h avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.