计算机网络/计算机科学与应用/系统/运维/开发

vue 获取数据列表接口

<script>

    const app = new Vue({

        el:'#app',

        data:{

           roleLst:[]

        },

        methods:{

            getRoleLst:function(){

                let roleUrl = "http://myadv.com/hadmin/role/getRoleLst";

                const _this=this;

                this.$http.get(roleUrl).then((res)=>{

                    console.log(res);

                    _this.roleLst = res.body.data;

                })

            },

            getUpdateIdData:function(id){

                alert(id)

            }


        },

        created(){

            this.getRoleLst();

        }

    });

</script>


微信小程序 https://www.javascriptcn.com/interview-weixinapp/677f48463d78df11d950b260.html

评论

^