Skip to content

More detailed description about useData() in docs #1515

Open
@Jinjiang

Description

Is your feature request related to a problem? Please describe.

In the docs, the returned value of useData() is described as:

interface VitePressData {
  site: Ref<SiteData>
  page: Ref<PageData>
  theme: Ref<any> // themeConfig from .vitepress/config.js
  frontmatter: Ref<PageData['frontmatter']>
  lang: Ref<string>
  title: Ref<string>
  description: Ref<string>
  localePath: Ref<string>
}

However, for theme, some of the fields are Proxy objects, and some of them are raw.

Take @vue/theme as an example:

image

These details are not reflected in our docs. This potentially leads users confused when they consume the data.

Describe the solution you'd like

Provide a more detailed description of the return value, and even better, an example.

Describe alternatives you've considered

No response

Additional context

A relevant issue: vuejs/theme#77

Thanks.

Validations

Metadata

Assignees

No one assigned

    Labels

    docsImprovements or additions to documentationstale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions