Vue Element 笔记

2019-05-15  本文已影响0人  wyc0859

表格获取index

下面2种方法获取:序号 type="index"、下标scope.$index

<el-table :data="category" border style="width: 100%" >
                        <el-table-column type="index" label="排序" width="70" >
                        </el-table-column>
                        <el-table-column prop="category_name" label="顶级分类" width="280">
                            <template slot-scope="scope">
                                <span>{{scope.row.category_name}}</span>
                            </template>
                        </el-table-column>
                        <el-table-column prop="short_name" label="标签">
                            <template slot-scope="scope"  v-if="scope.row.category_id != 8">
                                <el-input v-model="scope.$index" placeholder="请输入内容"></el-input>
                            </template>
                        </el-table-column>
                    </el-table>

修改表格行高 row-style和cell-style

<el-table :data="category" row-style="height:80px" cell-style="color:red;"  border>
上一篇下一篇

猜你喜欢

热点阅读