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

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>


照顾好自己,如果尚有余力,记得保护美好的东西,不畏不惧赤诚善良。

评论

^