当前位置:网站首页>[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>
边栏推荐
- LeetCode 496. Next larger element I
- 阿里云发送短信验证码
- 2310. The number of bits is the sum of integers of K
- Using request headers to develop multi terminal applications
- LeetCode 31. 下一个排列
- STM32 simple multi-level menu (array table lookup method)
- C # image difference comparison: image subtraction (pointer method, high speed)
- 干货整理!ERP在制造业的发展趋势如何,看这一篇就够了
- 【对象数组的排序】
- Node の MongoDB Driver
猜你喜欢

Android privacy sandbox developer preview 3: privacy, security and personalized experience

LeetCode 503. Next bigger Element II

Android 隐私沙盒开发者预览版 3: 隐私安全和个性化体验全都要

Unity SKFramework框架(二十二)、Runtime Console 运行时调试工具

C language - input array two-dimensional array a from the keyboard, and put 3 in a × 5. The elements in the third column of the matrix are moved to the left to the 0 column, and the element rows in ea

Applet global style configuration window

Vs code problem: the length of long lines can be configured through "editor.maxtokenizationlinelength"

Global configuration tabbar

LeetCode 556. 下一个更大元素 III

OpenGL - Lighting
随机推荐
【js 根据对象数组中的属性进行排序】
Applet network data request
A keepalived high availability accident made me learn it again
【对象数组a与对象数组b取出id不同元素赋值给新的数组】
Nodejs modularization
2310. 个位数字为 K 的整数之和
【el-table如何禁用】
MySQL does not take effect in sorting string types
Unity skframework framework (XXIII), minimap small map tool
[beauty of algebra] singular value decomposition (SVD) and its application to linear least squares solution ax=b
Nips2021 | new SOTA for node classification beyond graphcl, gnn+ comparative learning
Vs code problem: the length of long lines can be configured through "editor.maxtokenizationlinelength"
Introduction Guide to stereo vision (7): stereo matching
Multiple solutions to one problem, asp Net core application startup initialization n schemes [Part 1]
Kotlin introductory notes (VIII) collection and traversal
使用el-upload封装得组件怎么清空已上传附件
Generate confrontation network
【饿了么动态表格】
一次 Keepalived 高可用的事故,让我重学了一遍它
Nodemon installation and use