
vuejs
沐小馨yana
这个作者很懒,什么都没留下…
展开
-
js数组做数据聚合 groupBy函数的使用
今天写个关于数据聚合吧,就是返回的数据你要根据一个属性做计算。聚合用groupBy这个函数,它传两个形参一为对象数组,二为匿名函数(该函数功能:返回对象的某个指定属性的属性值并存放在数组中)groupBy(array, f) { var _that = this; _that.groupArr = []; const groups = {}; array.forEach(function(o) { const group = JSON.stringify原创 2020-10-16 17:07:00 · 3908 阅读 · 0 评论 -
Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-
这几天写项目遇见几个问题1、Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop be...原创 2019-10-12 12:00:31 · 287 阅读 · 0 评论 -
Vuejs滚动到一定位置固定导航栏
<active-btn @getData="getData" :class="fixed == true ? 'fixedBtn' :''"></active-btn>//这是我写的一个组件,getdata是用来获取组件传值的//以下是css代码.fixedBtn { position: fixed; //固定定位 top...原创 2019-08-26 18:14:32 · 2415 阅读 · 0 评论