当前位置:网站首页>【饿了么动态表格】
【饿了么动态表格】
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>
边栏推荐
- An article takes you into the world of cookies, sessions, and tokens
- Jenkins pipeline method (function) definition and call
- OpenGL - Lighting
- 生成对抗网络
- Vs code problem: the length of long lines can be configured through "editor.maxtokenizationlinelength"
- Ministry of transport and Ministry of Education: widely carry out water traffic safety publicity and drowning prevention safety reminders
- Transfer learning and domain adaptation
- 22-07-04 西安 尚好房-项目经验总结(01)
- Unity skframework framework (XXIII), minimap small map tool
- Deep understanding of C language pointer
猜你喜欢
Newton iterative method (solving nonlinear equations)
Rebuild my 3D world [open source] [serialization-1]
顶会论文看图对比学习(GNN+CL)研究趋势
[ManageEngine] how to make good use of the report function of OpManager
Nodemon installation and use
LeetCode 31. Next spread
混淆矩阵(Confusion Matrix)
22-07-04 西安 尚好房-项目经验总结(01)
LeetCode 503. 下一个更大元素 II
Priority queue (heap)
随机推荐
Rebuild my 3D world [open source] [serialization-1]
一篇文章带你走进cookie,session,Token的世界
Wxss template syntax
Android 隐私沙盒开发者预览版 3: 隐私安全和个性化体验全都要
2309. The best English letters with both upper and lower case
SMT32H7系列DMA和DMAMUX的一点理解
Introduction Guide to stereo vision (4): DLT direct linear transformation of camera calibration [recommended collection]
C # draw Bezier curve with control points for lattice images and vector graphics
Applet (use of NPM package)
OpenGL - Model Loading
生成对抗网络
浅谈Label Smoothing技术
基于STM32单片机的测温仪(带人脸检测)
植物大战僵尸Scratch
Multiple solutions to one problem, asp Net core application startup initialization n schemes [Part 1]
Transfer learning and domain adaptation
[team PK competition] the task of this week has been opened | question answering challenge to consolidate the knowledge of commodity details
A keepalived high availability accident made me learn it again
Huber Loss
Cloud computing technology hotspot