美文网首页
修改ant-design-vue中$message的图标

修改ant-design-vue中$message的图标

作者: _信仰zmh | 来源:发表于2021-03-19 09:33 被阅读0次

    比如this.$message.info('hahahha'),默认图标是个感叹号,如果想换成自己的图标就需要添加icon参数。

    icon参数支持a-icon和其他html标签,不过如果是img标签,src需要使用http网络地址,或者使用base64(比较长,不推荐),尝试使用本地图片的相对路径或者绝对路径,都不生效,显示裂图...

      test(){
           var self = this;
            this.$message.info('hahahha')
            this.$message.info({content:'hahaha',icon:<a-icon type="smile" style="color: red"/>})
            this.$message.info({content:'img',icon:<img style='width:20px;height:20px;' src="https://view.baocloud.cn:7090/custom_upload/metricType/变化量.svg"/>})
            // this.$message.info({content:'imglocal',icon:"<img style='width:20px;height:20px;' src='"+self.imglocal+"'/>"})
          },
    

    相关文章

      网友评论

          本文标题:修改ant-design-vue中$message的图标

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