美文网首页
ES6 find/JSON.parse/forEach

ES6 find/JSON.parse/forEach

作者: 曹锦花 | 来源:发表于2019-08-21 20:59 被阅读0次

ES6 find

{
    title: this.$t('nameVietnamese'),//名称-越
    render: (h, obj) => {
        let myArr = obj.row.giftNameLangues;
        let item = myArr.find(value => value.language == 'vi');
        return h('span', {}, item.name);
    }
},

JSON.parse

let obj = JSON.parse(JSON.stringify(this.newNationalRulesInfo))
this.addUserBaseInfo.countrySettingList.push(obj);
this.newNationalRules = false;

forEach

 if(this.auditBaseInfo.countrySettingList.length != 0){
   this.auditBaseInfo.countrySettingList.forEach((item, index) => {
     if(item.country == this.auditNewNationalRulesInfo.country){
       this.$Message.error('该国家已设置!');
     }else{
       this.confirmModal = true;
     }
   });
 }else{
  this.confirmModal = true;
 }

相关文章

网友评论

      本文标题:ES6 find/JSON.parse/forEach

      本文链接:https://www.haomeiwen.com/subject/tnhwsctx.html