在Vue.js列内显示数组数据

时间:2018-12-11 07:48:02

标签: vue.js vuejs2 element-ui

我想在webPage列内显示数组值,如果我要循环浏览网页,那么我将无法在其中循环数组,那么我会得到未定义的错误webPage。

var Main = {
    data() {
      return {
        tableData3: [{          
          name: 'Tom',
          webpage: ["Home", " Result"]
        }, {
         name: 'Jerry',
         webpage : ["Review", " Confirmation"]
        }]
      }
    }
  }
var Ctor = Vue.extend(Main)
new Ctor().$mount('#app')
@import url("//unpkg.com/element-ui@1.4.1/lib/theme-default/index.css");
<script src="//unpkg.com/vue/dist/vue.js"></script>
<script src="//unpkg.com/element-ui@1.4.1/lib/index.js"></script>
<div id="app">
  <template>
    <el-table :data="tableData3" border style="width: 100%">
      <el-table-column prop="name" label="Name" width="120" sortable>
        </el-table-column>
        <el-table-column label="Page" prop="webpage">
        </el-table-column>
    </el-table>
  </template>
</div>

0 个答案:

没有答案