天气预报插件

网址 : https://widget.qweather.com/

注册创建好

代码 : 

  html : 

<div id="he-plugin-standard"></div>
  js :  
 <script src="https://widget.qweather.net/standard/static/js/he-standard-common.js?v=2.0"></script>
created(){
this.__init(); // 天气预报 window.WIDGET = { CONFIG: { "layout": "2", "width": "230", "height": 270, "background": "5", "dataColor": "FFFFFF", "aqiColor": "FFFFFF", "borderRadius": "5", "key": "a39e4a73c5e44565b8f67d70cee3c2ac" }, }; var script = document.createElement("script"); script.type = "text/javascript"; script.src = "https://widget.qweather.net/standard/static/js/he-standard-common.js?v=2.0"; document.getElementsByTagName("head")[0].appendChild(script); },

 

 根据我的替换代码就好了~~完美

 

posted @ 2022-01-22 09:42  杨建鑫  阅读(541)  评论(0编辑  收藏  举报