LLEARNING NOTES

技术 · 思考 · 实践 · 成长

首页/Vue2/正文

vue 获取数据列表接口

Vue2568 次阅读

<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>


只有惜缘,才有缘分;只有惜友,才有友谊。

评论交流

理性讨论,共同进步
验证码

相关文章

继续阅读