axios获取天气预报

本文由星河分享,介绍如何通过axios获取天气接口数据,实现天气预报的展示。接口地址为http://wthrcdn.etouch.cn/weather_mini。代码中结合了Bootstrap样式,提供了获取和使用Bootstrap资源的提示。
摘要由CSDN通过智能技术生成

大家好!我是星河,今天给大家带来的是获取接口实现一个天气的情况

天气接口:http://wthrcdn.etouch.cn/weather_mini

这个是我写的部分style简陋的代码


        #app{
            width: 800px;
            margin: auto;
            margin-top: 100px;
        }
        h2{
            text-align: center;
            font-weight: bold;
            margin: 0 0 20px 0;
        }
        .about{
            margin-top: 5px;
        }
        .about a{
            text-decoration: none;
            font-weight: bold;
            font-size: 15px;
            color:black;
        }
        .about a:hover{
            color: blue;
        }

下面来看正文部分

<!-- vue数据的data数据会挂载到 app 里面 -->
    <div id="app">
        <!-- 标题 -->
        <h2>天气查询</h2>
        <!-- 使用 from 的类 是页面变得好看而已 -->
        <div class="form-group">
            <!--在in
  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值