Skip to content

Commit 86f947b

Browse files
committed
添加扩展 表单模板
1 parent c553bd5 commit 86f947b

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<template>
2+
<div class="form-page">
3+
<el-card shadow="never" class="form-card">
4+
<el-form :model="formData" ref="ruleForm">
5+
<div class="form-bottom-actions">
6+
<div></div>
7+
<div>
8+
<el-button
9+
class="submit-btn"
10+
type="primary"
11+
@click="submitForm('ruleForm')"
12+
>{{ isEdit ? "立即修改" : "立即创建" }}
13+
</el-button>
14+
<el-button class="submit-btn" @click="$router.go(-1)"
15+
>返回
16+
</el-button
17+
>
18+
</div>
19+
</div>
20+
</el-form>
21+
</el-card>
22+
</div>
23+
</template>
24+
<script>
25+
export default {
26+
props: {
27+
attrs: Object
28+
},
29+
data() {
30+
return {
31+
isEdit: false,
32+
formData: {}
33+
};
34+
},
35+
methods: {
36+
submitForm(formName) {
37+
this.$refs[formName].validate(valid => {
38+
if (valid) {
39+
} else {
40+
return false;
41+
}
42+
});
43+
},
44+
resetForm(formName) {
45+
this.$refs[formName].resetFields();
46+
}
47+
}
48+
};
49+
</script>
50+
<style lang="scss"></style>

0 commit comments

Comments
 (0)