Commit 4d6646f4 authored by 罗超's avatar 罗超

2

parent 40d6f904
......@@ -3,8 +3,8 @@
<q-card>
<q-card-section>
<div>
<span class="text-h6" v-if="addMsg.Id>0">修改</span>
<span class="text-h6" v-if="addMsg.Id==0">新增</span>
<span class="text-h6" v-if="addMsg.Id > 0">修改</span>
<span class="text-h6" v-if="addMsg.Id == 0">新增</span>
<q-btn
color="accent"
style="float:right;"
......@@ -28,6 +28,8 @@
v-model="addMsg.Title"
label="标题"
maxlength="50"
ref="title"
:rules="[val => !!val || '请输入标题']"
/>
<q-input
class="col-12 q-mb-sm"
......@@ -35,6 +37,7 @@
filled
v-model="addMsg.LinkUrl"
label="链接"
ref="link"
maxlength="1000"
/>
<q-input
......@@ -148,9 +151,8 @@ export default {
this.getDetail(this.addMsg.Id);
} else {
this.addMsg.Id = 0;
this.init(null)
this.init(null);
}
},
methods: {
goback() {
......@@ -196,12 +198,15 @@ export default {
this.ueditor.value = val;
},
saveData() {
setLearningGarden(this.addMsg).then(res => {
if(res.Code==1){
this.Success(res.Message)
this.goback()
}
});
this.$refs.title.validate();
if (!this.$refs.title.hasError) {
setLearningGarden(this.addMsg).then(res => {
if (res.Code == 1) {
this.Success(res.Message);
this.goback();
}
});
}
}
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment