当前位置:网站首页>【饿了么动态表格】
【饿了么动态表格】
2022-07-05 09:27:00 【果东布丁】
<template>
<div>
<el-button @click="add">新增一行</el-button>
<el-button @click="save">保存</el-button>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="compty" label="日期" width="180">
<template slot-scope="scope">
<el-input v-model="scope.row.compty" placeholder="请输入内容"></el-input>
</template>
</el-table-column>
<el-table-column prop="brand" label="姓名" width="180">
<template slot-scope="scope">
<el-select v-model="scope.row.brand" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="日期" width="180">
<template slot-scope="scope">
<el-button
@click.native.prevent="deleteRow(scope.$index, tableData)"
type="text"
size="small">
移除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
data() {
return {
compty: null,
tableData: [
// {
// date: '2016-05-02',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1518 弄'
// }, {
// date: '2016-05-04',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1517 弄'
// }, {
// date: '2016-05-01',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1519 弄'
// }, {
// date: '2016-05-03',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1516 弄'
// }
],
options: [{
value: '选项1',
label: '黄金糕'
}, {
value: '选项2',
label: '双皮奶'
}, {
value: '选项3',
label: '蚵仔煎'
}, {
value: '选项4',
label: '龙须面'
}, {
value: '选项5',
label: '北京烤鸭'
}],
}
},
created() {
},
methods: {
add() {
this.tableData.push({
compty: null,
brand: null,
})
},
save() {
console.log('保存的数据',this.tableData);
},
deleteRow(index,row) {
console.log('index',index);
console.log('row',row);
console.log(this.tableData);
this.tableData.splice(index,1)
}
},
}
</script>
边栏推荐
- Multiple solutions to one problem, asp Net core application startup initialization n schemes [Part 1]
- Understanding rotation matrix R from the perspective of base transformation
- Shutter uses overlay to realize global pop-up
- Hosting environment API
- nodejs_ 01_ fs. readFile
- [ctfhub] Title cookie:hello guest only admin can get flag. (cookie spoofing, authentication, forgery)
- 顶会论文看图对比学习(GNN+CL)研究趋势
- 利用请求头开发多端应用
- 【组队 PK 赛】本周任务已开启 | 答题挑战,夯实商品详情知识
- c语言指针深入理解
猜你喜欢
![Introduction Guide to stereo vision (3): Zhang calibration method of camera calibration [ultra detailed and worthy of collection]](/img/d8/39020b1ce174299f60b6f278ae0b91.jpg)
Introduction Guide to stereo vision (3): Zhang calibration method of camera calibration [ultra detailed and worthy of collection]

Composition of applet code

Newton iterative method (solving nonlinear equations)

Kotlin introductory notes (VII) data class and singleton class

【ManageEngine】如何利用好OpManager的报表功能

LeetCode 496. Next larger element I

A keepalived high availability accident made me learn it again

OpenGL - Coordinate Systems

Creation and reference of applet

A detailed explanation of the general process and the latest research trends of map comparative learning (gnn+cl)
随机推荐
Huber Loss
Kotlin introductory notes (III) kotlin program logic control (if, when)
AUTOSAR from getting started to mastering 100 lectures (103) -dbc file format and creation details
Applet (global data sharing)
Rebuild my 3D world [open source] [serialization-1]
Unity SKFramework框架(二十二)、Runtime Console 运行时调试工具
一篇文章带你走进cookie,session,Token的世界
Kotlin introductory notes (II) a brief introduction to kotlin functions
混淆矩阵(Confusion Matrix)
项目实战 | Excel导出功能
Can't find the activitymainbinding class? The pit I stepped on when I just learned databinding
Applet data attribute method
Introduction Guide to stereo vision (2): key matrix (essential matrix, basic matrix, homography matrix)
Uni app implements global variables
Introduction Guide to stereo vision (4): DLT direct linear transformation of camera calibration [recommended collection]
[ctfhub] Title cookie:hello guest only admin can get flag. (cookie spoofing, authentication, forgery)
Confusion matrix
【PyTorch Bug】RuntimeError: Boolean value of Tensor with more than one value is ambiguous
我的一生.
Editor use of VI and VIM