摘要: 1. for in 遍历自身与原型上的属性,可用hasOwnPorperty过滤 2.Object.keys遍历自身属性 3.Object.create创建一个纯净的对象,其prototype不指向构造函数 阅读全文
posted @ 2021-04-04 21:15 jianghongyun 阅读(37) 评论(0) 推荐(0)
摘要: 1.call的实现 1 Function.prototype.mycall = function (context) { 2 context.fn = this 3 const args = [...arguments].slice(1) 4 const result = context.fn(.. 阅读全文
posted @ 2021-03-29 16:16 jianghongyun 阅读(72) 评论(0) 推荐(0)
摘要: win10上打包linux树莓派架构的vue-electron 阅读全文
posted @ 2020-12-16 16:03 jianghongyun 阅读(3414) 评论(0) 推荐(1)
摘要: 1. 更新apt-get 1 sudo apt-get update 2. 安装nodejs 1 sudo apt-get install nodejs 3. 安装nodejs指定版本,包含npm(替换数字即可) 1 curl -sL https://deb.nodesource.com/setup 阅读全文
posted @ 2020-12-16 11:14 jianghongyun 阅读(11636) 评论(0) 推荐(0)
摘要: 使用vue的v-show指令时,echarts图表宽度为100px。基于准备好的dom,获取其父(祖先)节点元素的宽度,使dom元素的宽度等于其父(祖先)节点元素的宽度。代码如下: <div id="chartLine" class="chartLine" /> // 基于准备好的dom,初始化ec 阅读全文
posted @ 2020-09-23 14:51 jianghongyun 阅读(1736) 评论(0) 推荐(0)
摘要: 当使用for循环动态渲染表头时,表格视图不更新。经检查发现,key值原先绑定的是索引,即 :key="i",导致 item.prop改变后视图更新错乱,key值更改后 :key="item.prop",问题得到解决 <template v-for="(item, i) in tableColumn" 阅读全文
posted @ 2020-07-31 16:03 jianghongyun 阅读(1893) 评论(0) 推荐(1)
摘要: element-ui 表单input为readonly时如何进行校验 使用element-ui 进行表单验证时,对于绑定v-model赋值的input框,没有触发change、blur事件,因此表单提交时验证不通过。 阅读全文
posted @ 2020-05-29 14:57 jianghongyun 阅读(3338) 评论(0) 推荐(0)