1 <template>
2 <div >
3 <!--<img src="./assets/logo.png">-->
4 <router-view></router-view>
5 <button @click="send">发送ajax请求</button>
6 </div>
7
8 </template>
9
10 <script>
11 import axios from 'axios'
12 export default {
13 name: 'app',
14 data() {
15 return {
16 msg: 'Welcome to Your Vue.js App'
17 }
18 },
19 methods:{
20 send(){axios.get('https://api.github.com/users/Tiny3300')
21 .then(resp =>{
22 console.log(resp.data);
23 }).catch(err =>{
24 console.log(err);
25 });}
26 }
27 }
28 </script>
29
30 <style>
31 #app {
32 font-family: 'Avenir', Helvetica, Arial, sans-serif;
33 -webkit-font-smoothing: antialiased;
34 -moz-osx-font-smoothing: grayscale;
35 text-align: center;
36 color: #2c3e50;
37 margin-top: 60px;
38 }
39 </style>
View Code
<template>
<div ></style>