添加搜索框
This commit is contained in:
23
src/context/RepositorySearchContext.ts
Executable file
23
src/context/RepositorySearchContext.ts
Executable file
@@ -0,0 +1,23 @@
|
||||
import React from 'react'
|
||||
|
||||
export const RepositorySearchContext = React.createContext({
|
||||
|
||||
/**
|
||||
* 调用搜索接口
|
||||
* @param {string} keyword 搜索关键词
|
||||
* @param {number} page 页码
|
||||
*/
|
||||
search (keyword:string, page:number) {},
|
||||
|
||||
/**
|
||||
* 更新搜索关键词
|
||||
* @param {string} keyword 搜索关键词
|
||||
*/
|
||||
setKeyword (keyword:string) {},
|
||||
|
||||
/** 搜索关键词 */
|
||||
keyword: '',
|
||||
|
||||
/** 接口调用中 */
|
||||
loading: false
|
||||
})
|
Reference in New Issue
Block a user