Vue框架Element UI教程-页面渲染(八)
写了那么多,最终的数据都是要展示在前端的界面,才算是完成工作。Element UI手册:https://cloud.tencent.com/developer/doc/1270中文文档:http://element-cn.eleme.io/#/zh-CNgithub地址:https://github.com/ElemeFE/element其实步骤...
·
写了那么多,最终的数据都是要展示在前端的界面,才算是完成工作。
Element UI手册:https://cloud.tencent.com/developer/doc/1270
中文文档:http://element-cn.eleme.io/#/zh-CN
github地址:https://github.com/ElemeFE/element
其实步骤很简单,代码如下
<template>
<div id="app">
<div v-for="item in itemList">
<span>{{item.name}}</span>
<span>{{item.nick}}</span>
</div>
</div>
</template>
<script>
import axios from "axios";
export default {
name: "app",
data() {
return {
itemList: []
}
},
mounted() {
this.getData();
},
methods: {
getData() {
axios.get('http://localhost:8080/api/test').then(response => {
console.log(response.data);
this.itemList =response.data.first;
}, response => {
console.log("error");
});
}
}
}
</script>
打开界面,既可以看到,所需要的数据一家展示在前端的界面了
原文作者:祈澈姑娘 技术博客:https://www.jianshu.com/u/05f416aefbe1
90后前端妹子,爱编程,爱运营,文艺与代码齐飞,魅力与智慧共存的程序媛一枚,对于博客上面有不会的问题,欢迎加入编程微刊qq群:260352626。
以上几章demo代码写在了github上面,需要的可以参考,后续会继续完善:https://github.com/wangxiaoting666/Element-UI
更多推荐
已为社区贡献16条内容
所有评论(0)