闲来无事做 不如敲代码
<template> <view class="content"> <view v-if="list.length !== 0" class="todo-header"> <view class="todo-header__left"> <text class="active-text">{
{text}}text> <text>{
{listData.length}}条text> view> <view class="todo-header__right"> <view class="todo-header__right-item" :class="{'active-tab':activeIndex === 0}" @click="tab(0)">全部view> <view class="todo-header__right-item" :class="{'active-tab':activeIndex === 1}" @click="tab(1)">待办view> <view class="todo-header__right-item" :class="{'active-tab':activeIndex === 2}" @click="tab(2)">已完成view> view> view> <view v-if="list.length === 0" class="default"> <view class="image-default"> <image src="../../static/default.png" mode="aspectFit">image> view> <view class="default-info"> <view class="default-info__text">您还没有创建任何待办事项view> <view class="default-info__text">点击下方+号创建一个吧view> view> view> <view v-else class="todo-content"> <view class="todo-list" :class="{'todo--finish':item.checked}" v-for="(item,index) in listData" :key="index" @click="finish(item.id)"> <view class="todo-list__checkbox"> <view class="checkbox">view>