1.0.8 • Published 5 years ago

@hoksi/vuecmd v1.0.8

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago
window.$ = require("@hoksi/vuecmd/ajax.js");
import  Cmd  from  "@hoksi/vuecmd";

var mainloadingcount = 0;
var loading = null;
Vue.use(Cmd, {
	testing:true, //show console.log
    url: "../api/",
    data: {
	    "key":"value"
    },
	before: function () {
		//this is vue instance
		mainloadingcount += 1;
		setTimeout(() => {
			if (mainloadingcount && !loading) loading = this.$loading();
		}, 500);
	},
	after: function () {
		//this is vue instance
		mainloadingcount -= 1;
		setTimeout(() => {
			if (!mainloadingcount && loading) {
				loading.close();
				loading = null;
			}
		}, 1);
	}		
});

this.$cmdoptions.data["usertoken"]="";

this.$cmd

.setdata({
action: "path/to/action" }) .post(function(err, result) { });

overrideurl(url) //reset url completely
seturl(url) //append url to root url	
cleardata() 
adddata(key,value)
deletedata(key)
setdata(data) //append data 
post(callback)
get(callback)

import getusertoken from "@hoksi/vuecmd/getusertoken";
var usertoken = getusertoken();
1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago