diff --git a/README.md b/README.md index d6c7446..5de6a1d 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,12 @@

Axios + Vue = Axues ✌️

+

+ English + | + 简体中文 +

+ ## Features - 🦾 Full [axios](https://github.com/axios/axios) feature support @@ -61,7 +67,7 @@ app.mount('#app') ```javascript // main.js -import Vue, { h } from 'vue' +import Vue from 'vue' import axios from 'axios' import { createAxues } from 'axues' import App from './App.vue' @@ -70,7 +76,7 @@ const axues = createAxues(axios) Vue.use(axues.vue2Plugin) new Vue({ - render: () => h(App) + render: h => h(App) }).$mount('#app') ``` @@ -146,7 +152,7 @@ const { loading: loading3, data: bookData } = useAxues({ }) ``` -### Manual execute +### Manually execute The above examples all pass an `immediate` configuration, which means it will be executed immediately. If want to execute it manually, we need to call the `action` method returned by `useAxues`. @@ -186,6 +192,10 @@ const { loading, action } = useAxues({ ``` +> ### Why named as `action` instead of `execute` or others? +> +> The process from the beginning of a request to the completion of rendering is like a play, where the browser serves as the theater, the JS code as the script, HTML as the actors, and CSS as the props and costumes. As long as the director issues `action` instructions, the actors will perform according to the script. So who is the director? Of course, it's our user. + ### Built-in debounce By default, when the `action` is called frequently, it will only be executed if the previous request is completed, otherwise it will be ignored. @@ -242,7 +252,7 @@ const { error, action, retryTimes, retryCountdown, retry, retrying } = useAxues( ``` +> ### Why named as `action` instead of `execute` or others? +> +> The process from the beginning of a request to the completion of rendering is like a play, where the browser serves as the theater, the JS code as the script, HTML as the actors, and CSS as the props and costumes. As long as the director issues `action` instructions, the actors will perform according to the script. So who is the director? Of course, it's our user. + ### Built-in debounce By default, when the `action` is called frequently, it will only be executed if the previous request is completed, otherwise it will be ignored. @@ -242,7 +252,7 @@ const { error, action, retryTimes, retryCountdown, retry, retrying } = useAxues(