Skip to content
This repository was archived by the owner on Dec 9, 2022. It is now read-only.

Commit 88d42f0

Browse files
committed
change request function
1 parent 5ad6d91 commit 88d42f0

15 files changed

+103
-65
lines changed

README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ Vue.use(OctoberApi, { axios });
1717
<template>
1818
<form
1919
v-october:request.prevent="{
20-
'handler': 'onSignin',
21-
'onLoading': onLoading,
22-
'onError': onError,
23-
'onSuccess': onSuccess,
24-
'redirect': '/'
20+
handler: 'onSignin',
21+
onLoading: onLoading,
22+
onError: onError,
23+
onSuccess: onSuccess,
24+
redirect: '/'
2525
}"
2626
>
2727
<text-input
@@ -39,10 +39,7 @@ Vue.use(OctoberApi, { axios });
3939
type="password"
4040
/>
4141
42-
<button
43-
:disabled="errors.any()"
44-
type="submit"
45-
>Login</button>
42+
<button :disabled="errors.any()" type="submit">Login</button>
4643
</form>
4744
</template>
4845
@@ -93,8 +90,7 @@ new Vue({
9390

9491
formData.append("input", input);
9592

96-
this.$october.request({
97-
handler: "onSubmit",
93+
this.$october.request("onSubmit", {
9894
formData
9995
// onLoading: onLoading,
10096
// onError: onError,

lib/index.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import { AxiosStatic } from "axios";
22
import { PluginObject } from "vue/types/plugin";
3-
import { RequestFunction } from "./request";
3+
import { RequestProps } from "./request";
44
export interface PluginOptions {
55
readonly axios: AxiosStatic;
66
readonly timeout?: number;
77
readonly headers?: Readonly<Record<string, string>>;
88
}
9+
export declare type RequestFunction = {
10+
(handler: string, options: RequestProps): () => void;
11+
};
912
declare const plugin: PluginObject<PluginOptions>;
1013
export default plugin;
1114
declare module "vue/types/vue" {

lib/index.js

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/index.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/index.min.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)