项目总结

88 阅读1分钟

项目总结

软件使用

使用vscode 时候 ctrl + shift + N 打开新窗口 使用 Ctrl + R 选择最近的项目进行切换
hbuiderx 项目目录消失时候 点击视图可重新找回
source tree 同步git 代码文件 是相当顺手的

代码封装 与常见常量配置

使用一个 可以一键切换环境地址的全局对象
globalSrote.js

class devGlobalStore {
	host = ""; 
	prefix = ""; 
	static = "/sit/static"; 
	version = '1.0.5'; 
	tmp = null; 
}

class GlobalStore {
	host = ""; 
	prefix = ""; 
	static = "/static"; 
	version = '1.0.5'; 
	tmp = null; 
} 

const globalStore = 1 == 1 ? new GlobalStore() : new devGlobalStore();
export default globalStore;
  
/*  
 生产需要去掉 manifest.json 设置里面的 Web 配置  
 static 属性可以用 vue 挂载了全局对象时 image 图片写  :src="global.static + '/logox.png'"这样可以灵活切换 
 uniapp 写web变量标签时候需要注意 比如localStorage img 标签 项目最好先手机调试
 对于main.js 减少代码长度 可以将挂载属性的方法 分离
 使用 Object.assign(Vue.prototype,tool) 进行引入
*/