- 博客(10)
- 收藏
- 关注
原创 git clone大文件或者二进制文件报错
git clone大文件或者二进制文件报错遇到大文件首先会用到 git-lfs 组件,但在实际操作过程中还是会有一些报错导致无法完成 git 的克隆操作。报错的关键词会有“Error downloading object”,“Smudge error”,“Error downloading”这类。首先安装git-lfs组件 ,网上到处都有,随便都能搜到,这里不再细说;安装好git-lfs组件后,记得在git bash里跑下git-lfs version指令确认安装成功(安装成功会有版本号出现)
2021-09-15 15:11:35
2391
原创 获得当月有多少天
function getMonthCountDay ( year, month){return 32 - new Date( year, month -1, 32). getDate();}
2021-06-04 16:41:37
108
原创 VUE中不要用index作为key
** VUE中不要用index作为key**key是Vue中的通过v-for循环出来的虚拟dom的唯一标记,并且key在组件整个生命周期中需要保持稳定性。通过key可使diff算法操作更快更准确,提高虚拟dom的操作性能。不要用index作为key,由于sameVnode函数,可能会重新更新虚拟dom(属性、类名、样式、指令),从而增加真实dom的操作。更不要用随机数作为key,由于sameVnode函数,会触发创建新节点、删除旧节点、销毁节点,降低性能。(销毁一个dom节点并创建一个新的再插入是
2021-06-01 16:31:49
466
原创 new Vue(), Vue.prototype.config, Vue.use(),三者的区分
iview组件里的main.js文件中会出现new Vue(), Vue.prototype.XX, Vue.use()这三种引用方式方式
2020-01-04 16:34:43
2886
原创 js的 '|' 和 '&' 运算
先上代码和结果。console.log(0|0); // 0console.log(1|0); // 1console.log(0|2); // 2console.log(1|2); // 3console.log(1&0); // 0console.log(2&0); // 0console.log(1&2); // 0console.log(2&...
2019-10-23 17:16:00
197
原创 node踩坑之This is probably not a problem with npm. There is likely additional logging output above.错误
node踩坑之This is probably not a problem with npm. There is likely additional logging output above.错误欢迎使用Markdown编辑器欢迎使用Markdown编辑器可能由于种种版本更新的原因需要执行npm install重新安装一次,如果还是不可以的话,在把之前装的都清空rm -rf node_...
2019-06-12 17:51:44
642
原创 iView的Card卡片组件相关
1. 增加Card卡片后的高度渲染问题Vue.js 通常鼓励开发人员沿着“数据驱动”的方式思考,避免直接接触 DOM。this.$nextTick()官方介绍:将回调延迟到下次 DOM 更新循环之后执行。在修改数据之后立即使用它,然后等待 DOM 更新。它跟全局方法 Vue.nextTick 一样,不同的是回调的 this 自动绑定到调用它的实例上。Vue 实现响应式并不是数据发生变化之...
2019-05-07 10:53:33
4843
原创 iView的Tabs组件相关
代码例子如下:<Tabs type="card"> <TabPane v-for="tab in tabArr" :key="tab.id" :label="tab.name"> <component :is="tab.code"></component> </TabPane&g...
2019-05-07 09:44:36
1884
1
原创 JS的一些小技巧
1. 运用Set对象对数组中的值去重这个技巧的适用范围是数组中的数值的类型为:undefined, null, boolean, string, number。当包涵object, function, array时,则不适用。const array = [1, 2, 3, 3, 5, 5, 1];const uniqueArray = [...new Set(array)];con...
2019-04-23 16:42:40
119
原创 js中数组常用方法总结
js中数组常用方法总结1. Array.map()此方法是将数组中的每个元素调用一个提供的函数,结果作为一个新的数组返回,并没有改变原来的数组。let arr = [1, 2, 3, 4, 5]let newArr = arr.map(x => x*2)//arr= [1, 2, 3, 4, 5] 原数组保持不变//newArr = [2, 4, 6, 8, 10] 返回...
2019-04-22 16:31:31
171
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人