亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用 Vue 過濾表列

使用 Vue 過濾表列

烙印99 2021-10-07 10:59:29
我已經成功地用 Vue 構建了一個表,它有下拉列表作為每列的標題。每個下拉列表的值來自不同的 axios 調用作為數組,并且它們被正確填充。我遇到的問題是,第二次我過濾任何列時,它隱藏了整個表,并且無法重置它以將其恢復。所以它根本沒有正確過濾,也沒有回到“全部顯示”選項。我在這里做錯了什么:<table style="width:100%; text-align:center;">      <thead>          <tr>                  <th>                  <select v-model="filters.resource">                    <option v-for="resource in resources" :value="resource">{{ resource.name }}</option>                  </select>              </th>              <th>                  <select v-model="filters.location">                    <option v-for="location in locations" :value="location">{{ location.name }}</option>                  </select>              </th>              <th></th>              <th>                  <select v-model="filters.status">                    <option v-for="status in statuses" :value="status">{{ status }}</option>                  </select>              </th>              <th></th>          </tr>      </thead>      <tbody  v-for="event in filtered">          <tr>              <td>{{ event.resource }}</td>              <td>{{ event.location }}</td>              <td>{{ event.status }}</td>          </tr>      </tbody>  </table>  <script>  export default {      data () {          return {              events: [],              locations: [],              resources: [],              filters: {                title: null,                resource: null,                location: null,                status: null,              },          }      },   
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 196 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號