Skip to content

Commit

Permalink
Merge branch 'feature/[email protected]'
Browse files Browse the repository at this point in the history
  • Loading branch information
JOU-amjs committed Jun 24, 2024
2 parents 4783b46 + d571cfe commit 1f80e8c
Show file tree
Hide file tree
Showing 634 changed files with 90,320 additions and 57,698 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
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
116 changes: 58 additions & 58 deletions .github/workflows/deploy-docs.yml
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
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/build
pnpm-lock.yaml
package-lock.json
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
printWidth: 120, // 换行字符串阈值
printWidth: 96, // 换行字符串阈值
tabWidth: 2, // 设置工具每一个水平缩进的空格数
useTabs: false, // 是否使用tab缩进
semi: true, // 句末是否加分号
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# The alova doc Website

The official website of alova.
6 changes: 3 additions & 3 deletions babel.config.js
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')]
};
18 changes: 9 additions & 9 deletions codesandbox/00-create-alova/react.js
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()
});
18 changes: 9 additions & 9 deletions codesandbox/00-create-alova/svelte.js
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()
});
18 changes: 9 additions & 9 deletions codesandbox/00-create-alova/vueComposition.js
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()
});
18 changes: 9 additions & 9 deletions codesandbox/00-create-alova/vueOptions.js
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()
});
24 changes: 12 additions & 12 deletions codesandbox/01-getting-started/02-first-request/get.js
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;
});
32 changes: 16 additions & 16 deletions codesandbox/01-getting-started/02-first-request/post.js
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;
});
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;
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;
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>
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>
Loading

0 comments on commit 1f80e8c

Please sign in to comment.