当前位置:网站首页>Render follows, encapsulating a form and adding data to the table
Render follows, encapsulating a form and adding data to the table
2022-06-29 15:11:00 【Evening [email protected]】
render Here comes the follow-up , Form adding data to a table 

<script>
export default {
data() {
return {
tableData: [{
date: '2016-05-02',
name: ' X.h. ',
age: ' male ',
address: ' Jinshajiang road, putuo district, Shanghai 1518 get '
}, {
date: '2016-05-04',
name: ' X.h. ',
age: ' male ',
address: ' Jinshajiang road, putuo district, Shanghai 1517 get '
}, {
date: '2016-05-01',
name: ' X.h. ',
age: ' male ',
address: ' Jinshajiang road, putuo district, Shanghai 1519 get '
}, {
date: '2016-05-03',
name: ' X.h. ',
age: ' male ',
address: ' Jinshajiang road, putuo district, Shanghai 1516 get '
}],
form: {
name: "name",
sex: " male ",
timer: "2022-06-28",
address: " Address ",
}
}
},
render: function(createElement) {
const that = this
return createElement('div', {
attrs: {
id: "content"
}
}, [
createElement('div', {
attrs: {
class: "div1"
}
}, [
createElement('el-table', {
style: {
width: '100%',
},
props: {
data: this.tableData,
},
ref: 'extendTable'
}, [
createElement('el-table-column', { props: { prop: "date", label: " date ", align: "center" } }),
createElement('el-table-column', { props: { prop: "name", label: " full name ", align: "center" } }),
createElement('el-table-column', { props: { prop: "age", label: " Gender ", align: "center" } }),
createElement('el-table-column', { props: { prop: "address", label: " Address ", align: "center" } }),
createElement('el-table-column', {
props: { label: " operation ", align: "center" },
scopedSlots: {
default: props => createElement('el-button', {
domProps: {
innerHTML: " Click on "
},
on: {
click: function() {
console.log(props, ' The value of the current row ', props.row);
},
},
})
},
}),
])
]),
createElement('div', {
attrs: {
class: "div2"
},
style: {
marginTop: "50px",
width: "400px",
textAlign: "left"
}
}, [
createElement('el-button', {
props: {
type: "primary"
},
style: {
marginBottom: "20px"
},
domProps: {
innerHTML: " Add data "
},
on: {
click: function() {
that.tableData.push({
date: that.form.timer,
name: that.form.name,
age: that.form.sex,
address: that.form.address
})
}
}
}),
createElement('el-form', {
props: {
labelWidth: "80px"
},
ref: 'form1'
}, [
createElement('el-form-item', {
props: {
label: " full name ",
}
}, [
createElement('el-input', {
props: {
value: that.form.name
},
on: {
input: function(event) {
that.form.name = event
}
}
})
]),
createElement('el-form-item', {
props: {
label: " Gender "
}
}, [
createElement('el-select', {
props: {
value: that.form.sex
},
on: {
change: function(event) {
that.form.sex = event
}
}
}, [
createElement('el-option', {
props: {
label: " male ",
value: " male "
}
}),
createElement('el-option', {
props: {
label: " Woman ",
value: " Woman "
}
})
])
]),
createElement('el-form-item', {
props: {
label: " date "
}
}, [
createElement('el-date-picker', {
props: {
value: that.form.timer,
type: 'date',
valueFormat: 'yyyy-MM-dd'
},
on: {
input: function(event) {
that.form.timer = event
}
}
})
]),
createElement('el-form-item', {
props: {
label: " Address "
}
}, [
createElement('el-input', {
props: {
type: "textarea",
value: this.form.address
},
on: {
input: function(event) {
that.form.address = event
},
}
})
])
]
)]
)]
)
},
}
</script>
版权声明
本文为[Evening [email protected]]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/180/202206291440089879.html
边栏推荐
- 期货开户可以线下开户吗?在网上开户安全吗?
- Whitelabel error page access
- 如果我在佛山,到哪里开户比较好?究竟网上开户是否安全么?
- Lumiprobe click chemistry - non fluorescent alkyne: hexanoic acid STP ester
- Differences between @resource and @autowired annotations automatically injected:
- 他山之石 | 丁香园 医疗领域图谱的构建与应用
- The 5th China software open source innovation competition | opengauss track live training
- Indice d'évaluation du logiciel hautement simultané (site Web, interface côté serveur)
- Construction and application of medical field Atlas of dingxiangyuan
- Basic use of text preprocessing library Spacy (quick start)
猜你喜欢

Construction and application of medical field Atlas of dingxiangyuan

揭秘百度智能测试在测试自动执行领域实践

在平面坐标上画斜线

信息学奥赛一本通1194:移动路线

Draw a slash on a plane coordinate

重磅!2022最新SCI影响因子发布,三大名刊NCS及国内期刊TOP10排名有变化 (内附2022年最新影响因子)

wieshark抓包mysql协议简单分析

Imitation headline news information DZ template discuz news information business version GBK template source code

Solution to the problem that the assembly drawing cannot be recognized after the storage position of SolidWorks part drawing is changed

Real software testers = "half product + Half development"?
随机推荐
If I am in Foshan, where can I open an account? Is it safe to open an account online?
阿里云体验有奖:使用PolarDB-X与Flink搭建实时数据大屏
第九章 APP项目测试(4) 测试工具
在平面坐标上画斜线
携程季报图解:净营收41亿 与疫情前相比已被“腰斩”
MCS:离散随机变量——几何分布
两个字的名字如何变成有空格的3个字符的名字
Lumiprobe 活性染料丨环炔染料:AF488 DBCO,5 异构体
Unity C# 基础复习27——委托示例(P448)
信息学奥赛一本通1194:移动路线
Abnormal logic reasoning problem of Huawei software test written test [2] Huawei hot interview problem
Yi Ming ang Ke rushed to Hong Kong shares: loss of 730million in the year Lilly and sunshine life insurance were shareholders
高並發軟件(網站,服務器端接口)的評價指標
微信公众号—菜单
Biovendor free light chain( κ and λ) Chemical properties of ELISA Kit
word如何自动生成目录
Lumiprobe 脱氧核糖核酸丨炔烃dT亚磷酰胺
Lumiprobe 点击化学丨非荧光叠氮化物:叠氮化物-PEG3-OH
PyTorch 二维多通道卷积运算方式
Whitelabel error page access