当前位置:网站首页>[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>
边栏推荐
- Transfer learning and domain adaptation
- 【PyTorch Bug】RuntimeError: Boolean value of Tensor with more than one value is ambiguous
- Analysis of eventbus source code
- OpenGL - Model Loading
- LeetCode 503. 下一个更大元素 II
- SMT32H7系列DMA和DMAMUX的一点理解
- nodejs_ 01_ fs. readFile
- [beauty of algebra] solution method of linear equations ax=0
- 使用el-upload封装得组件怎么清空已上传附件
- Editor use of VI and VIM
猜你喜欢
随机推荐
干货整理!ERP在制造业的发展趋势如何,看这一篇就够了
2311. Longest binary subsequence less than or equal to K
深入浅出PyTorch中的nn.CrossEntropyLoss
OpenGL - Lighting
Global configuration tabbar
notepad++
阿里云发送短信验证码
22-07-04 Xi'an Shanghao housing project experience summary (01)
Hi Fun Summer, play SQL planner with starrocks!
Kotlin introductory notes (I) kotlin variables and non variables
Applet (use of NPM package)
Wxss template syntax
太不好用了,长文章加图文,今后只写小短文
Driver's license physical examination hospital (114-2 hang up the corresponding hospital driver physical examination)
nodejs_ fs. writeFile
微信小程序获取住户地区信息
Introduction Guide to stereo vision (7): stereo matching
LeetCode 556. 下一个更大元素 III
Hosting environment API
Kotlin introductory notes (II) a brief introduction to kotlin functions









