根据sorted进行了排序 效果如下:
使用vue实现,index.html核心代码
<div class="p4 square-operation-item "
:class="[-1==cindex?'active':'']" @click="searchByCid(0,-1)">
全部
</div>
<div class="p4 square-operation-item"
v-for="(blogcate,index) in blogCategories"
:class="[index==cindex?'active':'']"
@click="searchByCid(blogcate.id,index)">
{
{index+1}}/{
{blogcate.categoryTitle}}
</<