【发布时间】:2020-05-15 09:38:10
【问题描述】:
由于在 vue.js v-2 中删除了 orderBy 过滤器,我现在想知道如何重写此代码部分:
<li class="day" v-for="day in days | orderBy 'unix' 1" v-bind:class="{ 'outside': day.outsideOfCurrentMonth, 'empty': day.events.length === 0 }">
我想写
<li class="day" v-for="day in orderedDays"{{}}>
但不知道括号里写什么,orderBy()写什么:
computed: {
orderedDays: function () {
return _.orderBy()
}
}
Here 是完整的组件。 有人可以帮忙吗?
【问题讨论】:
-
这能回答你的问题吗? Vue.js: can't orderBy in v-for
标签: javascript css vue.js components