Browse Source

test

master
domsgit 5 years ago
parent
commit
2444f49981
1 changed files with 10 additions and 3 deletions
  1. 13
      src/components/HelloWorld.vue

13
src/components/HelloWorld.vue

@ -19,7 +19,8 @@
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
</ul>
<h3>Essentia Links</h3>
<h2>后端接口数据{{apimsg}}</h2>
<h2>yapi接口数据{{mockmsg}}</h2>
</div>
</template>
@ -29,12 +30,18 @@ import axios from 'axios'
export default {
name: 'HelloWorld',
props: {
msg: String
msg: String,
mockmsg: '',
apimsg: '',
},
mounted() {
axios
.get('http://192.168.0.170:30532/mock/45/hello')
.then(res => console.log(res))
.then(res => this.mockmsg = res)
.catch(err => console.error(err))
axios
.get('http://192.168.0.170:30011/hello')
.then(res => this.apimsg = res)
.catch(err => console.error(err))
}
}

Loading…
Cancel
Save