您当前的位置: 首页 >  php

知其黑、受其白

暂无认证

  • 0浏览

    0关注

    1250博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Vue+axios+php使用v-for遍历显示数据

知其黑、受其白 发布时间:2021-11-29 19:49:28 ,浏览量:0

阅读目录
  • default.html
  • index.php
  • Promise对象中[[PromiseResult]]的取值

default.html
DOCTYPE html>



    
    
    Demo
    
    



    


const app=Vue.createApp({ 
    data(){
        return{
            list: []
        }
    },
    mounted() {
        // this.list = ['1-小红','2-小影','3-小丽'];
        const ax = axios.get('http://tt.cc', {
                    params: {
                      ID: 12345
                    }
                  })
                  .then(function (response) {
                    return response;
                  })
                  .catch(function (error) {
                    console.log(error);
                  })

        ax.then(res=>{
            // console.log(res.data);
            this.list = res.data;
        });
    },
    template: `
            
  • {{item}}
` }); const vm=app.mount("#app")

在这里插入图片描述

index.php
            
关注
打赏
1665558895
查看更多评论
0.0478s