1.0.2 • Published 6 years ago

fetch-vue-pro v1.0.2

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

Project Title

fetch-vue-pro

依赖

whatag-fetch npm i # whatag-fetch

安装

npm i # fetch-vue-pro

使用

import fetch-vue from 'fetch-vue-pro'

Vue.user(fetch-vue)

拥有全局变量 APIHOST 项目跟路径

example

const DEVSERVER = '//10.0.0.32:1088/projectName/'

const PRODSERVER = '/projectName/'

if (process.env.NODE_ENV === 'development') {

window.APIHOST = DEVSERVER

} else if (process.env.NODE_ENV === 'production') {

window.APIHOST = PRODSERVER

}

请求方式

get

this.$http.get(url)

or

post

数据格式

form

this.$http.postForm(url,data)

json

this.$http.postJson(url,data)

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

7 years ago