var messagetype={
            OA消息: "oa"
            markdown消息: "markdown"
            卡片消息: "action_card"
            图片消息: "image"
            文件消息: "file"
            文本消息: "text"
            链接消息: "link"
     }
     for (let key in messagetype) {
     console.log(key);//获取对象属性
     console.log(messagetype[key]);//获取对象属性对应的值

        //将遍历出的对象和属性转换成数组,push到数组中
        this.dingdingType.push({
          name: key,
          type:messagetype[key],
        });
      }

 

Logo

Vue社区为您提供最前沿的新闻资讯和知识内容

更多推荐