-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/[email protected]'
- Loading branch information
Showing
634 changed files
with
90,320 additions
and
57,698 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,58 @@ | ||
name: Doc deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
# 如果你想要进一步定义触发条件、路径等,可以查看文档 | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy to GitHub Pages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: npm | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build website | ||
run: npm run build | ||
|
||
# 部署到 GitHub Pages 的热门选择: | ||
# 文档:https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# 要发布到 `gh-pages` 分支的构建输出: | ||
publish_dir: ./build | ||
# 下面两行会将此次部署 commit 的作者设置为官方的 | ||
# GH-Actions 机器人: | ||
# https://github.com/actions/checkout/issues/13#issuecomment-724415212 | ||
# 如果不设置这两个字段,GH actions 机器人会被默认使用。 | ||
# 你可以用自己的用户信息替换它们。 | ||
# user_name: github-actions[bot] | ||
# user_email: 41898282+github-actions[bot]@users.noreply.github.com | ||
|
||
algolia: | ||
name: Crawl with algolia | ||
needs: [deploy] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Run algolia/docsearch-scraper image | ||
env: | ||
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} | ||
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} | ||
run: | | ||
docker run \ | ||
--env APPLICATION_ID=${ALGOLIA_APP_ID} \ | ||
--env API_KEY=${ALGOLIA_API_KEY} \ | ||
--env "CONFIG=$(cat docsearch.json | jq -r tostring)" \ | ||
algolia/docsearch-scraper | ||
name: Doc deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
# 如果你想要进一步定义触发条件、路径等,可以查看文档 | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy to GitHub Pages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: npm | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build website | ||
run: npm run build | ||
|
||
# 部署到 GitHub Pages 的热门选择: | ||
# 文档:https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# 要发布到 `gh-pages` 分支的构建输出: | ||
publish_dir: ./build | ||
# 下面两行会将此次部署 commit 的作者设置为官方的 | ||
# GH-Actions 机器人: | ||
# https://github.com/actions/checkout/issues/13#issuecomment-724415212 | ||
# 如果不设置这两个字段,GH actions 机器人会被默认使用。 | ||
# 你可以用自己的用户信息替换它们。 | ||
# user_name: github-actions[bot] | ||
# user_email: 41898282+github-actions[bot]@users.noreply.github.com | ||
|
||
algolia: | ||
name: Crawl with algolia | ||
needs: [deploy] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Run algolia/docsearch-scraper image | ||
env: | ||
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} | ||
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} | ||
run: | | ||
docker run \ | ||
--env APPLICATION_ID=${ALGOLIA_APP_ID} \ | ||
--env API_KEY=${ALGOLIA_API_KEY} \ | ||
--env "CONFIG=$(cat docsearch.json | jq -r tostring)" \ | ||
algolia/docsearch-scraper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/build | ||
pnpm-lock.yaml | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# The alova doc Website | ||
|
||
The official website of alova. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')] | ||
}; | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { createAlova } from 'alova'; | ||
import GlobalFetch from 'alova/GlobalFetch'; | ||
import ReactHook from 'alova/react'; | ||
export const alovaInstance = createAlova({ | ||
baseURL: 'https://jsonplaceholder.typicode.com', | ||
statesHook: ReactHook, | ||
requestAdapter: GlobalFetch(), | ||
responded: response => response.json() | ||
}); | ||
import { createAlova } from 'alova'; | ||
import GlobalFetch from 'alova/GlobalFetch'; | ||
import ReactHook from 'alova/react'; | ||
export const alovaInstance = createAlova({ | ||
baseURL: 'https://jsonplaceholder.typicode.com', | ||
statesHook: ReactHook, | ||
requestAdapter: GlobalFetch(), | ||
responded: response => response.json() | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { createAlova } from 'alova'; | ||
import GlobalFetch from 'alova/GlobalFetch'; | ||
import SvelteHook from 'alova/svelte'; | ||
export const alovaInstance = createAlova({ | ||
baseURL: 'https://jsonplaceholder.typicode.com', | ||
statesHook: SvelteHook, | ||
requestAdapter: GlobalFetch(), | ||
responded: response => response.json() | ||
}); | ||
import { createAlova } from 'alova'; | ||
import GlobalFetch from 'alova/GlobalFetch'; | ||
import SvelteHook from 'alova/svelte'; | ||
export const alovaInstance = createAlova({ | ||
baseURL: 'https://jsonplaceholder.typicode.com', | ||
statesHook: SvelteHook, | ||
requestAdapter: GlobalFetch(), | ||
responded: response => response.json() | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { createAlova } from 'alova'; | ||
import GlobalFetch from 'alova/GlobalFetch'; | ||
import VueHook from 'alova/vue'; | ||
export const alovaInstance = createAlova({ | ||
baseURL: 'https://jsonplaceholder.typicode.com', | ||
statesHook: VueHook, | ||
requestAdapter: GlobalFetch(), | ||
responded: response => response.json() | ||
}); | ||
import { createAlova } from 'alova'; | ||
import GlobalFetch from 'alova/GlobalFetch'; | ||
import VueHook from 'alova/vue'; | ||
export const alovaInstance = createAlova({ | ||
baseURL: 'https://jsonplaceholder.typicode.com', | ||
statesHook: VueHook, | ||
requestAdapter: GlobalFetch(), | ||
responded: response => response.json() | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { VueOptionsHook } from '@alova/vue-options'; | ||
import { createAlova } from 'alova'; | ||
import GlobalFetch from 'alova/GlobalFetch'; | ||
export const alovaInstance = createAlova({ | ||
baseURL: 'https://jsonplaceholder.typicode.com', | ||
statesHook: VueOptionsHook, | ||
requestAdapter: GlobalFetch(), | ||
responded: response => response.json() | ||
}); | ||
import { VueOptionsHook } from '@alova/vue-options'; | ||
import { createAlova } from 'alova'; | ||
import GlobalFetch from 'alova/GlobalFetch'; | ||
export const alovaInstance = createAlova({ | ||
baseURL: 'https://jsonplaceholder.typicode.com', | ||
statesHook: VueOptionsHook, | ||
requestAdapter: GlobalFetch(), | ||
responded: response => response.json() | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { createAlova } from 'alova'; | ||
import GlobalFetch from 'alova/GlobalFetch'; | ||
|
||
const alovaInstance = createAlova({ | ||
requestAdapter: GlobalFetch() | ||
}); | ||
alovaInstance | ||
.Get('https://jsonplaceholder.typicode.com/todos/1') | ||
.then(response => response.text()) | ||
.then(data => { | ||
app.innerHTML = data; | ||
}); | ||
import { createAlova } from 'alova'; | ||
import GlobalFetch from 'alova/GlobalFetch'; | ||
|
||
const alovaInstance = createAlova({ | ||
requestAdapter: GlobalFetch() | ||
}); | ||
alovaInstance | ||
.Get('https://jsonplaceholder.typicode.com/todos/1') | ||
.then(response => response.text()) | ||
.then(data => { | ||
app.innerHTML = data; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { createAlova } from 'alova'; | ||
import GlobalFetch from 'alova/GlobalFetch'; | ||
|
||
const alovaInstance = createAlova({ | ||
requestAdapter: GlobalFetch() | ||
}); | ||
alovaInstance | ||
.Post('https://jsonplaceholder.typicode.com/posts', { | ||
title: 'foo', | ||
body: 'bar', | ||
userId: 1 | ||
}) | ||
.then(response => response.text()) | ||
.then(data => { | ||
app.innerHTML = data; | ||
}); | ||
import { createAlova } from 'alova'; | ||
import GlobalFetch from 'alova/GlobalFetch'; | ||
|
||
const alovaInstance = createAlova({ | ||
requestAdapter: GlobalFetch() | ||
}); | ||
alovaInstance | ||
.Post('https://jsonplaceholder.typicode.com/posts', { | ||
title: 'foo', | ||
body: 'bar', | ||
userId: 1 | ||
}) | ||
.then(response => response.text()) | ||
.then(data => { | ||
app.innerHTML = data; | ||
}); |
30 changes: 15 additions & 15 deletions
30
codesandbox/01-getting-started/03-combine-framework/react-useRequest.en.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { useRequest } from 'alova'; | ||
import { alovaInstance } from './api'; | ||
|
||
const App = () => { | ||
// Use the alova instance to create a method and pass it to useRequest to send the request | ||
const { loading, data, error } = useRequest(alovaInstance.Get('/todos/1')); | ||
|
||
if (loading) { | ||
return <div>Loading...</div>; | ||
} else if (error) { | ||
return <div>{error.message}</div>; | ||
} | ||
return <span>responseData: {JSON.stringify(data)}</span>; | ||
}; | ||
export default App; | ||
import { useRequest } from 'alova'; | ||
import { alovaInstance } from './api'; | ||
|
||
const App = () => { | ||
// Use the alova instance to create a method and pass it to useRequest to send the request | ||
const { loading, data, error } = useRequest(alovaInstance.Get('/todos/1')); | ||
|
||
if (loading) { | ||
return <div>Loading...</div>; | ||
} else if (error) { | ||
return <div>{error.message}</div>; | ||
} | ||
return <span>responseData: {JSON.stringify(data)}</span>; | ||
}; | ||
export default App; |
30 changes: 15 additions & 15 deletions
30
codesandbox/01-getting-started/03-combine-framework/react-useRequest.zh.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { useRequest } from 'alova'; | ||
import { alovaInstance } from './api'; | ||
|
||
const App = () => { | ||
// 使用alova实例创建method并传给useRequest即可发送请求 | ||
const { loading, data, error } = useRequest(alovaInstance.Get('/todos/1')); | ||
|
||
if (loading) { | ||
return <div>Loading...</div>; | ||
} else if (error) { | ||
return <div>{error.message}</div>; | ||
} | ||
return <span>responseData: {JSON.stringify(data)}</span>; | ||
}; | ||
export default App; | ||
import { useRequest } from 'alova'; | ||
import { alovaInstance } from './api'; | ||
|
||
const App = () => { | ||
// 使用alova实例创建method并传给useRequest即可发送请求 | ||
const { loading, data, error } = useRequest(alovaInstance.Get('/todos/1')); | ||
|
||
if (loading) { | ||
return <div>Loading...</div>; | ||
} else if (error) { | ||
return <div>{error.message}</div>; | ||
} | ||
return <span>responseData: {JSON.stringify(data)}</span>; | ||
}; | ||
export default App; |
26 changes: 13 additions & 13 deletions
26
codesandbox/01-getting-started/03-combine-framework/vueComposition-useRequest.en.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<template> | ||
<div v-if="loading">Loading...</div> | ||
<div v-else-if="error">{{ error.message }}</div> | ||
<span v-else>responseData: {{ data }}</span> | ||
</template> | ||
|
||
<script setup> | ||
import { useRequest } from 'alova'; | ||
import { alovaInstance } from './api'; | ||
// Use the alova instance to create a method and pass it to useRequest to send the request | ||
const { loading, data, error } = useRequest(alovaInstance.Get('/todos/1')); | ||
</script> | ||
<template> | ||
<div v-if="loading">Loading...</div> | ||
<div v-else-if="error">{{ error.message }}</div> | ||
<span v-else>responseData: {{ data }}</span> | ||
</template> | ||
|
||
<script setup> | ||
import { useRequest } from 'alova'; | ||
import { alovaInstance } from './api'; | ||
// Use the alova instance to create a method and pass it to useRequest to send the request | ||
const { loading, data, error } = useRequest(alovaInstance.Get('/todos/1')); | ||
</script> |
26 changes: 13 additions & 13 deletions
26
codesandbox/01-getting-started/03-combine-framework/vueComposition-useRequest.zh.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<template> | ||
<div v-if="loading">Loading...</div> | ||
<div v-else-if="error">{{ error.message }}</div> | ||
<span v-else>responseData: {{ data }}</span> | ||
</template> | ||
|
||
<script setup> | ||
import { useRequest } from 'alova'; | ||
import { alovaInstance } from './api'; | ||
// 使用alova实例创建method并传给useRequest即可发送请求 | ||
const { loading, data, error } = useRequest(alovaInstance.Get('/todos/1')); | ||
</script> | ||
<template> | ||
<div v-if="loading">Loading...</div> | ||
<div v-else-if="error">{{ error.message }}</div> | ||
<span v-else>responseData: {{ data }}</span> | ||
</template> | ||
|
||
<script setup> | ||
import { useRequest } from 'alova'; | ||
import { alovaInstance } from './api'; | ||
// 使用alova实例创建method并传给useRequest即可发送请求 | ||
const { loading, data, error } = useRequest(alovaInstance.Get('/todos/1')); | ||
</script> |
Oops, something went wrong.