去除vue中相关警告语

1.SweetAlert2插件警告

SweetAlert2: “setDefaults” & “resetDefaults” methods are deprecated in favor of “mixin” method and will be removed in the next major release. For new projects, use “mixin”. For past projects already using “setDefaults”, support will be provided through an additional package.

大致意思:SweetAlert2插件中的setDefaults方法过期,使用mixin方法即可,如下:

import swal from 'sweetalert2';
export default {
  install: (Vue) => {
    // sweetalert2 的设置默认配置的方法
    swal.mixin({
      //type: 'warning',
      showCancelButton: true,
      cancelButtonText:'取消',
      confirmButtonText:'确认',
      confirmButtonColor: 'rgb(140,212,245)',       
      cancelButtonColor: 'rgb(193,193,193)'

    });
    // 添加全局方法
    Vue.swal = swal;
    // 添加实例方法
    Vue.prototype.$swal = swal;

  }
}

详细介绍可以查看官方文档:
相关链接: https://sweetalert2.github.io/#examples.

2.百度api插件警告:

parser-blocking, cross site (i.e. different eTLD+1) script, http://api.map.baidu.com/getscript?v=3.0&ak=EfW7687887888888464h&services=&t=20676767676, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.

将引用中的api换成getscript即可,如下:

原链接:
<script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=5464546456464645654Alh"></script>
修改后链接:
<script type="text/javascript" src="http://api.map.baidu.com/getscript?v=3.0&ak=5464546456464645654Alh"></script>
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客
应支付0元
点击重新获取
扫码支付

支付成功即可阅读