| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <template>
- <el-table
- :data="tableData"
- style="width: 100%">
- <el-table-column
- prop="code"
- label="编码"
- width="180">
- </el-table-column>
- <el-table-column
- prop="name"
- label="名称"
- width="180">
- </el-table-column>
- </el-table>
- </template>
- <script>
- import Vue from 'vue';
- import ElementUI from 'element-ui';
- import Axios from 'axios';
- import 'element-ui/lib/theme-chalk/index.css';
- Vue.use(ElementUI);
- // http://api.sagacloud.cn/data-platform-3/dict/query/climate
- export default{
- data: function () {
- return {
- tableData: [{
- date: '2016-05-02',
- name: '王小虎',
- address: '上海市普陀区金沙江路 1518 弄'
- }, {
- date: '2016-05-04',
- name: '王小虎',
- address: '上海市普陀区金沙江路 1517 弄'
- }, {
- date: '2016-05-01',
- name: '王小虎',
- address: '上海市普陀区金沙江路 1519 弄'
- }, {
- date: '2016-05-03',
- name: '王小虎',
- address: '上海市普陀区金沙江路 1516 弄'
- }]
- };
- },
- components: {},
- created: function () {
- this.getData()
- },
- mounted: function () {
- },
- computed: {},
- methods: {
- getData(){
- Axios.get('http://api.sagacloud.cn/data-platform-3/dict/query/climate',{}).then(res=>{
- this.tableData = res.data.Content;
- })
- }
- },
- }
- </script>
|