vue http请求 vue-resource使用方法


App.vue 添加代码

template
    div
        div
            loading v-show="isShowLoading"/loading
        /div
        router-link to="/Login"跳转到详情页/router-link
        img src="/upload/attach/blank.gif"  data-echo="./assets/logo.png"
        router-view/router-view
  /div
  
/template
script

import loading from ‘./components/Loading‘
import {mapGetters} from ‘vuex‘
export default {
    name: ‘app‘,
    components:{
        loading
    },
    data () {
        return {
        }
    },
    //computed 实时计算 Vue检测到数据发生变动时就会执行对相应数据有引用的函数。
    computed: {
        ...mapGetters([
            ‘isShowLoading‘
        ])
    }
}
/script

style
#app {
  font-family: ‘Avenir‘, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
/style

  

vue http请求 vue-resource使用方法

原文地址:http://www.cnblogs.com/gouge/p/7284927.html


最新回复(0)
/jishuIhTBncFVquamlo86gb3T8kU0dxW0M5HwqQo6Uw_3D_3D4719161
8 简首页