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

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>


人生建议:不要因为嘴硬而失去重要的东西,清醒,知趣,明得失,知进退。

评论

^