File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 22
22
</template >
23
23
24
24
<script >
25
- import { postAdd } from ' @/api/config'
25
+ import { postAdd , getList } from ' @/api/config'
26
26
27
27
export default {
28
28
data () {
@@ -44,7 +44,18 @@ export default {
44
44
redirect: ' /config/index'
45
45
}
46
46
},
47
+ created () {
48
+ this .init ()
49
+ },
47
50
methods: {
51
+ init () {
52
+ const that = this
53
+ getList ({ perPage: 20 }).then (response => {
54
+ const data = response .data
55
+ that .form .name = data .name
56
+ that .form .default_open = data .default_open
57
+ })
58
+ },
48
59
onSubmit (form ) {
49
60
// console.log(this.form)
50
61
this .$refs [form].validate ((valid ) => {
@@ -58,7 +69,7 @@ export default {
58
69
message: ' 操作成功' ,
59
70
type: ' success'
60
71
})
61
- this .$router .push ({ path: this .redirect || ' /' })
72
+ // this.$router.push({ path: this.redirect || '/' })
62
73
} else {
63
74
this .$message .error (response .reason )
64
75
}
You can’t perform that action at this time.
0 commit comments