当前位置:网站首页>【饿了么动态表格】
【饿了么动态表格】
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>
边栏推荐
- Ministry of transport and Ministry of Education: widely carry out water traffic safety publicity and drowning prevention safety reminders
- C form click event did not respond
- 太不好用了,长文章加图文,今后只写小短文
- Introduction Guide to stereo vision (5): dual camera calibration [no more collection, I charge ~]
- OpenGL - Lighting
- Project practice | excel export function
- High performance spark_ Transformation performance
- C # image difference comparison: image subtraction (pointer method, high speed)
- LeetCode 31. Next spread
- Talking about label smoothing technology
猜你喜欢
[reading notes] Figure comparative learning gnn+cl
Progressive JPEG pictures and related
Editor use of VI and VIM
Unity SKFramework框架(二十四)、Avatar Controller 第三人称控制
LeetCode 496. 下一个更大元素 I
An article takes you into the world of cookies, sessions, and tokens
Node collaboration and publishing
Introduction Guide to stereo vision (7): stereo matching
Figure neural network + comparative learning, where to go next?
LeetCode 31. 下一个排列
随机推荐
Can't find the activitymainbinding class? The pit I stepped on when I just learned databinding
Rebuild my 3D world [open source] [serialization-1]
Uni app implements global variables
[beauty of algebra] solution method of linear equations ax=0
阿里十年测试带你走进APP测试的世界
STM32简易多级菜单(数组查表法)
MYSQL 对字符串类型排序不生效问题
Applet customization component
Newton iterative method (solving nonlinear equations)
Rebuild my 3D world [open source] [serialization-2]
2311. Longest binary subsequence less than or equal to K
Talking about the difference between unittest and pytest
【PyTorch Bug】RuntimeError: Boolean value of Tensor with more than one value is ambiguous
Project practice | excel export function
Vs code problem: the length of long lines can be configured through "editor.maxtokenizationlinelength"
C语言-从键盘输入数组二维数组a,将a中3×5矩阵中第3列的元素左移到第0列,第3列以后的每列元素行依次左移,原来左边的各列依次绕到右边
[technical school] spatial accuracy of binocular stereo vision system: accurate quantitative analysis
图神经网络+对比学习,下一步去哪?
Understanding rotation matrix R from the perspective of base transformation
LeetCode 31. 下一个排列