Skip to content

[Need Help] A parameter is missing. Was it done intentionally or was this parameter forgotten to be added #260

@hero8080

Description

@hero8080

问题描述 Problem Description

createQuery设计的initialState参数,实际调用该函数时,initialState参数丢失
在此处定义vue-request\src\core\createQuery.ts

const createQuery = <R, P extends unknown[]>(
  service: Service<R, P>,
  config: Options<R, P>,
  initialState?: UnWrapRefObject<State<R, P>>,
): Query<R, P>

使用vue-request\src\core\useQuery.ts

function useQuery<R, P extends unknown[]>(
  service: Service<R, P>,
  options: Options<R, P> = {},
  plugins: PluginImplementType<R, P>[],
): QueryResult<R, P> {
  // 其他代码已省略...
  const queryInstance = createQuery(service, config 👇这个位置缺少一个参数);
  // 其他代码已省略...
}

Image

Image

实际用的时候

其他信息 Other information

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions