Skip to content

Register global components in themes #281

Closed
@harryhorton

Description

@harryhorton

Vue Press version: 0.8.4

In .vuepress/ components are automatically registered when they're placed in components/. As a developer, my assumption was that the theme/ folder would have a similar feature.

Components can be registered with a pattern like this:

//.vuepress/theme/enhanceApp.js

import PostList from './components/PostList'
import PostSnippet from './components/PostSnippet'

export default ({
    Vue, // the version of Vue being used in the VuePress app
    options, // the options for the root Vue instance
    router, // the router instance for the app
    siteData // site metadata
  }) => {
    Vue.component('PostList', PostList)
    Vue.component('PostSnippet', PostSnippet)
  }

But it would be nice if the theme could mirror functionality of .vuepress/ structures like components/

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: feature requestRequest to add a new featureversion: nextPlanned to do or already included in the next(1.0.0) version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions