当前位置:网站首页>[hungry dynamic table]
[hungry dynamic table]
2022-07-05 09:28:00 【Guodong pudding】
<template>
<div>
<el-button @click="add"> Add a new line </el-button>
<el-button @click="save"> preservation </el-button>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="compty" label=" date " width="180">
<template slot-scope="scope">
<el-input v-model="scope.row.compty" placeholder=" Please enter the content "></el-input>
</template>
</el-table-column>
<el-table-column prop="brand" label=" full name " width="180">
<template slot-scope="scope">
<el-select v-model="scope.row.brand" placeholder=" Please select ">
<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=" date " width="180">
<template slot-scope="scope">
<el-button
@click.native.prevent="deleteRow(scope.$index, tableData)"
type="text"
size="small">
remove
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
data() {
return {
compty: null,
tableData: [
// {
// date: '2016-05-02',
// name: ' X.h. ',
// address: ' Jinshajiang road, putuo district, Shanghai 1518 get '
// }, {
// date: '2016-05-04',
// name: ' X.h. ',
// address: ' Jinshajiang road, putuo district, Shanghai 1517 get '
// }, {
// date: '2016-05-01',
// name: ' X.h. ',
// address: ' Jinshajiang road, putuo district, Shanghai 1519 get '
// }, {
// date: '2016-05-03',
// name: ' X.h. ',
// address: ' Jinshajiang road, putuo district, Shanghai 1516 get '
// }
],
options: [{
value: ' Options 1',
label: ' Golden cake '
}, {
value: ' Options 2',
label: ' Double skin milk '
}, {
value: ' Options 3',
label: ' Oyster omelet '
}, {
value: ' Options 4',
label: ' dragon whiskers noodles '
}, {
value: ' Options 5',
label: ' Beijing Roast Duck '
}],
}
},
created() {
},
methods: {
add() {
this.tableData.push({
compty: null,
brand: null,
})
},
save() {
console.log(' Saved data ',this.tableData);
},
deleteRow(index,row) {
console.log('index',index);
console.log('row',row);
console.log(this.tableData);
this.tableData.splice(index,1)
}
},
}
</script>
边栏推荐
- OpenGL - Lighting
- 一题多解,ASP.NET Core应用启动初始化的N种方案[上篇]
- .NET服务治理之限流中间件-FireflySoft.RateLimit
- Lepton 无损压缩原理及性能分析
- VS Code问题:长行的长度可通过 “editor.maxTokenizationLineLength“ 进行配置
- 【饿了么动态表格】
- Svg optimization by svgo
- Applet (use of NPM package)
- 浅谈Label Smoothing技术
- Introduction Guide to stereo vision (5): dual camera calibration [no more collection, I charge ~]
猜你喜欢
干货整理!ERP在制造业的发展趋势如何,看这一篇就够了
Kotlin introductory notes (V) classes and objects, inheritance, constructors
Huber Loss
Confusion matrix
Applet (use of NPM package)
Generate confrontation network
A keepalived high availability accident made me learn it again
C form click event did not respond
Applet data attribute method
初识结构体
随机推荐
Creation and reference of applet
Introduction Guide to stereo vision (4): DLT direct linear transformation of camera calibration [recommended collection]
Vs code problem: the length of long lines can be configured through "editor.maxtokenizationlinelength"
LeetCode 503. 下一个更大元素 II
基于STM32单片机的测温仪(带人脸检测)
Priority queue (heap)
Applet (subcontracting)
LeetCode 503. Next bigger Element II
nodejs_ fs. writeFile
fs. Path module
A keepalived high availability accident made me learn it again
SMT32H7系列DMA和DMAMUX的一点理解
顶会论文看图对比学习(GNN+CL)研究趋势
阿里十年测试带你走进APP测试的世界
【组队 PK 赛】本周任务已开启 | 答题挑战,夯实商品详情知识
My life
Applet global style configuration window
What is a firewall? Explanation of basic knowledge of firewall
浅谈Label Smoothing技术
22-07-04 西安 尚好房-项目经验总结(01)