Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7959745

Browse files
committed
Fix: keep data to update good
1 parent fabc5e3 commit 7959745

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

‎src/components/panel.vue‎

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -62,25 +62,24 @@
6262
'jsonUrl',
6363
'id'
6464
],
65-
//created() {
66-
// if(this.jsonUrl )
67-
// this.$http.get('/api/goodDetail/' + this.$route.params.id)
68-
// .then(res => {
69-
// let code = res.data.code;
70-
// if (code === 0) {
71-
// this.good = res.data.result;
72-
// this.updateRoute = '/update/' + this.good.id;
73-
// this.good.price = price(this.good.price);
74-
// } else {
75-
// this.$message({
76-
// type: 'error',
77-
// message: res.data.msg
78-
// });
79-
// }
80-
// }).catch(error => {
81-
82-
// })
83-
// },
65+
created() {
66+
if(this.jsonUrl.includes("update")) {
67+
this.$http.get('/api/goodDetail/' + this.$route.params.id)
68+
.then(res => {
69+
let code = res.data.code;
70+
if (code === 0) {
71+
this.good = res.data.result;
72+
this.good.price = price(this.good.price);
73+
} else {
74+
this.$message({
75+
type: 'error',
76+
message: res.data.msg
77+
});
78+
}
79+
}).catch(error => {
80+
})
81+
}
82+
},
8483
methods: {
8584
submit: function() {
8685
this.good.img = this.$refs.imgUpload.img;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /