发表于: 2020-03-31 21:15:06

1 1503



今天完成的事情:

1.推进任务


明天计划的事情:

1.推进任务


遇到的问题和收获:

<el-button v-show="this.$route.query.id === undefined" type="success" @click="draft"
          :disabled="isValid">存为草稿
</el-button>
<!--            编辑时显-->
<el-button v-show="this.$route.query.id !== undefined" type="warning" @click="edit"
          :disabled="isValid">存为草稿
</el-button>


按钮的可用是通过计算属性来判断的。如果选项类型为3,行业大图时,需要判断所有的参数是否为空,如果选项里面不是行业大图,则不需要判断industry的存在。

isValid() 

   if (this.article.type === '3') {
       // console.log(this.article.industry);
       console.log(this.article.industry);
       return this.article.title === undefined
           || this.article.content === undefined
           || this.article.url === undefined
           || this.article.type === undefined
           || this.article.industry === undefined
           || this.article.industry === ''
           // || this.fileList === [];
           || this.fileList.length === 0;
   } else {
       this.article.industry = undefined
       console.log(this.article.industry);
       return this.article.title === undefined
           || this.article.content === undefined
           || this.article.url === undefined
           || this.article.type === undefined
           // || this.fileList === [];
           || this.fileList.length === 0;
   }


},


这是为了判断类型是否为行业大图,是的话,industry的选项会显示,否则会隐藏。

//type3图时为
isType() {
   return this.article.type === '3';
}




返回列表 返回列表
评论

    分享到