require('xx').default
加default的原因,链接
import require区别
import静态编译,require不是。
const url = 'xxxx' + 'yyyy'
import url,报错。require(url)不报错。动态加载使用require。
process.env.NODE_ENV
process是全局变量,提供node的有关信息,env是它的属性。
输入node,再输入process.env即可打印。
NODE_ENV不是对象原有属性,是添加上去的环境变量。

dayjs
格式时间的插件,2kb,支持所有的浏览器
dayjs文档


d2admin页面发请求过程





mock拦截请求,模拟数据的过程
actionFn({commit, dispatch}, {xx: xx, yy: yy} = {}, {root: true})参数
第二个参数是为了初始化值为空,并且运行之初不报错
mixins作用

hasOwnProperty
判断对象有没有这个属性,返回布尔值
const object1 = new Object();
object1.property1 = 42;
console.log(object1.hasOwnProperty('property1'));
// expected output: true
console.log(object1.hasOwnProperty('toString'));
// expected output: false
在不继承的情况下迭代
var o = {
a: 'aa',
b: 'bb',
c: {
c1: '11',
c2: '22'
}
}
let newO = {}
for (const n in o) {
if(o.hasOwnProperty(n)) {
newO[n] = o[n]
}
}
console.log(newO)
lowdb
lowdbgithub地址
Small JSON database for Node, Electron and the browser
数据保存在db.json或者LocalStorage里的
