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 2222</template >
2323
2424<script >
25- import { postAdd } from ' @/api/config'
25+ import { postAdd , getList } from ' @/api/config'
2626
2727export default {
2828 data () {
@@ -44,7 +44,18 @@ export default {
4444 redirect: ' /config/index'
4545 }
4646 },
47+ created () {
48+ this .init ()
49+ },
4750 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+ },
4859 onSubmit (form ) {
4960 // console.log(this.form)
5061 this .$refs [form].validate ((valid ) => {
@@ -58,7 +69,7 @@ export default {
5869 message: ' 操作成功' ,
5970 type: ' success'
6071 })
61- this .$router .push ({ path: this .redirect || ' /' })
72+ // this.$router.push({ path: this.redirect || '/' })
6273 } else {
6374 this .$message .error (response .reason )
6475 }
You can’t perform that action at this time.
0 commit comments