功能:1.点击“回车”或“搜索”查询天气
2.点击搜索框下的城市,直接搜索
天气接口:http://wthrcdn.etouch.cn/weather_mini?city=北京
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<!-- 导入vue -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<!-- 导入axios -->
<script src="https://unpkg.com/axios@0.21.1/dist/axios.min.js"></script>
<style>
*{
padding:0;
margin: 0;
list-style: none;
border:0;
}
a{
color: #000;
text-decoration: none;
}
#box{
width: 800px;
margin: 100px auto;
}
#header h1{
text-align: center;
padding: 20px 0;
/*字体渐变*/
background-image: -webkit-linear-gradient(