Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vxe-ajax

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vxe-ajax - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

14

index.js

@@ -0,9 +1,11 @@

import * as ajax from '../xe-ajax'
/**
* Install VxeAjax
*/
function plugin (Vue, func) {
var constructor = func.ajax
function plugin (Vue, methods) {
ajax.mixin(methods)
var XEAjax = ajax.constructor
Object.defineProperty(Vue, 'ajax', function () {
constructor.context = window
return constructor
XEAjax.context = window
return XEAjax
})

@@ -13,4 +15,4 @@ Object.defineProperties(Vue.prototype, {

get () {
constructor.context = this
return constructor
XEAjax.context = this
return XEAjax
}

@@ -17,0 +19,0 @@ }

{
"name": "vxe-ajax",
"version": "1.0.5",
"version": "1.0.6",
"description": "vxe-ajax 基于Vue全局安装xe-ajax",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -12,10 +12,27 @@ # vxe-ajax 基于Vue全局安装xe-ajax

import Vue from 'vue'
import XEAjax from 'xe-ajax'
import VXEAjax from 'vxe-ajax'
Vue.use(VXEAjax, XEAjax)
Vue.use(VXEAjax)
// 在Vue实例中使用
this.$ajax.getJSON ('url', {id: 1}).then(data => {
data
}).catch(data => {
data
})
```
### 支持自定义扩展
``` shell
import Vue from 'vue'
import VXEAjax from 'vxe-ajax'
import customs from './customs' // ./customs.js export function custom1 () {}
Vue.use(VXEAjax, customs)
// 调用自定义扩展函数
this.$ajax.custom1()
```
## License
Copyright (c) 2017-present, Xu Liangzhan
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc