|
+| | [46](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_46) | |
+| | [47](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_47) | Current Count: {{ counter.count }}
|
+| | [48](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_48) | |
+| | [49](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_49) | ``` |
+| | [50](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_50) | |
+| | [51](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_51) | #### 更真实的示例 |
+| | [52](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_52) | 这是一个更完整的 Pinia API 示例,在 JavaScript 中也使用了类型提示。对于某些开发者来说,可能足以在不进一步阅读的情况下直接开始阅读本节内容,但我们仍然建议你先继续阅读文档的其余部分,甚至跳过此示例,在阅读完所有核心概念之后再回来。 |
+| | [53](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_53) | |
+| | [54](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_54) | ``` |
+| | [55](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_55) | js |
+| | [56](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_56) | import { defineStore } from 'pinia' |
+| | [57](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_57) | |
+| | [58](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_58) | export const useTodos = defineStore('todos', { |
+| | [59](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_59) | state: () => ({ |
+| | [60](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_60) | /** @type {{ text: string, id: number, isFinished: boolean }[]} */ |
+| | [61](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_61) | todos: [], |
+| | [62](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_62) | /** @type {'all' \| 'finished' \| 'unfinished'} */ |
+| | [63](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_63) | filter: 'all', |
+| | [64](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_64) | // 类型将自动推断为 number |
+| | [65](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_65) | nextId: 0, |
+| | [66](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_66) | }), |
+| | [67](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_67) | getters: { |
+| | [68](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_68) | finishedTodos(state) { |
+| | [69](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_69) | // 自动补全! ✨ |
+| | [70](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_70) | return state.todos.filter((todo) => todo.isFinished) |
+| | [71](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_71) | }, |
+| | [72](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_72) | unfinishedTodos(state) { |
+| | [73](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_73) | return state.todos.filter((todo) => !todo.isFinished) |
+| | [74](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_74) | }, |
+| | [75](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_75) | /** |
+| | [76](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_76) | * @returns {{ text: string, id: number, isFinished: boolean }[]} |
+| | [77](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_77) | */ |
+| | [78](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_78) | filteredTodos(state) { |
+| | [79](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_79) | if (this.filter === 'finished') { |
+| | [80](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_80) | // 调用其他带有自动补全的 getters ✨ |
+| | [81](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_81) | return this.finishedTodos |
+| | [82](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_82) | } else if (this.filter === 'unfinished') { |
+| | [83](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_83) | return this.unfinishedTodos |
+| | [84](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_84) | } |
+| | [85](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_85) | return this.todos |
+| | [86](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_86) | }, |
+| | [87](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_87) | }, |
+| | [88](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_88) | actions: { |
+| | [89](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_89) | // 接受任何数量的参数,返回一个 Promise 或不返回 |
+| | [90](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_90) | addTodo(text) { |
+| | [91](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_91) | // 你可以直接变更该状态 |
+| | [92](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_92) | this.todos.push({ text, id: this.nextId++, isFinished: false }) |
+| | [93](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_93) | }, |
+| | [94](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_94) | }, |
+| | [95](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_95) | }) |
+| | [96](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e01c8fd434d6df6219fb454488b8f0bc8f65b07d_0_96) | ``` |
\ No newline at end of file
diff --git "a/\351\253\230\344\277\212\346\235\260/2024.05.14.md" "b/\351\253\230\344\277\212\346\235\260/2024.05.14.md"
new file mode 100644
index 0000000000000000000000000000000000000000..2d6232e4583f0bd93ce767b92fa1df18736689e2
--- /dev/null
+++ "b/\351\253\230\344\277\212\346\235\260/2024.05.14.md"
@@ -0,0 +1,31 @@
+| ## API和REST | | |
+| ------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
+| | [2](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_2) | |
+| | [3](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_3) | ### API |
+| | [4](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_4) | |
+| | [5](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_5) | Application Programming Interface(应用程序接口)是它的全称。简单的理解就是,API是一个接口 |
+| | [6](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_6) | |
+| | [7](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_7) | ### REST |
+| | [8](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_8) | |
+| | [9](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_9) | HTTP总共包含八种方法: |
+| | [10](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_10) | |
+| | [11](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_11) | ``` |
+| | [12](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_12) | GET |
+| | [13](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_13) | POST |
+| | [14](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_14) | PUT |
+| | [15](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_15) | DELETE |
+| | [16](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_16) | OPTIONS |
+| | [17](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_17) | HEAD |
+| | [18](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_18) | TRACE |
+| | [19](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_19) | CONNECT |
+| | [20](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_20) | ``` |
+| | [21](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_21) | |
+| | [22](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_22) | ● 2xx = Success(成功) |
+| | [23](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_23) | |
+| | [24](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_24) | ● 3xx = Redirect(重定向) |
+| | [25](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_25) | |
+| | [26](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_26) | ● 4xx = User error(客户端错误) |
+| | [27](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_27) | |
+| | [28](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_28) | ● 5xx = Server error(服务器端错误) |
+| | [29](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_29) | |
+| | [30](https://gitee.com/level-22-net-class/net-front-end-class-vue-notes/pulls/283/files#e12b19311e4ae4b81756fa1031666192a530add9_0_30) | 我们常见的是200(请求成功)、404(未找到)、401(未授权)、500(服务器错误)... |
\ No newline at end of file