美文网首页
Vue Element 笔记

Vue Element 笔记

作者: wyc0859 | 来源:发表于2019-05-15 22:58 被阅读0次

表格获取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>

相关文章

网友评论

      本文标题:Vue Element 笔记

      本文链接:https://www.haomeiwen.com/subject/elevaqtx.html