image.png

代码

<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="//static.gzj2001.com/vue/vue.js"></script>
    <script src="//static.gzj2001.com/vue/axios.min.js"></script>
</head>
<body>
    <div id="app">
        获取的内容{{neirong}}
    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                neirong:"123123"
            },
            methods:{
            nr:function(){
                axios.get(`https://www.2013.chat/api/index`)
                .then(function(response){
                    this.neirong=response.date;
                    console.log(response);
                }.bind(this))
                .catch(function(error){
                    console.log(error);
                })
            }
        }
        })
        
    </script>
</body>
</html>