这是一个系列,记录我vue开发常用的代码,小常识,有些是参考网上代码,(讲的可能有点烂,求不要打脸,嘤嘤嘤~~)送给那些需要的人。可以相互交流,喜欢的加我吧。
Wx: Lxp911221
首先推荐一款免搭建,前端,移动端静态服务器mock-api,用npm安装(需要node环境)
npm install mock-api -g –registry=https://registry.npm.taobao.org
使用点击查看详情
使用过程中跨域怎么办,启动终端Terminal,输入以下命令,你的浏览器就可以跨域了。
注意:每次启动浏览器都要用这命令奥!!!
Mac:
chrome49以前版本
open -a "Google Chrome" --args --disable-web-security
chrome49以后版本
open -a /Applications/Google\ Chrome.app --args --disable-web-security --user-data-dir
Safari
open -a '/Applications/Safari.app' --args --disable-web-security
Window:
chrome.exe --disable-web-security