vue3 uses element plus's el-table to report an error Uncaught TypeError: data.includes is not a function

 question:

el-table rendering error,

 <el-table :data="order.order_logs" :header-cell-style="headerCellStyle">
          <el-table-column prop="price" label="操作类型"></el-table-column>
          <el-table-column label="操作IP" prop="subtotal"></el-table-column>
          <el-table-column label="时间" prop="OperatorTime"></el-table-column>
        </el-table>

//..初始化
 //订单详情
      const order = ref({
        order_logs: {}
      })

Analyze and solve

It's no problem to change the field. I found that it is initialization.

 :data="order_logs" There is a problem with this field: order_logs. The type mismatch should be an array and not an object.

solve:

The initial data field of el-table is an array.

const order = ref({  order_logs: []   })

Guess you like

Origin blog.csdn.net/LlanyW/article/details/135380429