@mdx-js/vue
MDX support for Vue components
Last updated 2 months ago by johno .
MIT · Original npm · Tarball · package.json
$ cnpm install @mdx-js/vue 
SYNC missed versions from official npm registry.

@mdx-js/vue

Build Status lerna Chat

@mdx-js/vue works together with the @mdx-js/vue-loader to map Vue components to HTML elements based on the Markdown syntax.

This module also exports the MDXProvider that accepts an object with a map of all components you to be rendered in the HTML.

Installation

npm install --save @mdx-js/vue

Usage

In your Markdown file:

<!-- helloworld.md -->

# Hello, Vue!

In your main.js:

import Vue from 'vue'
import { MDXProvider } from '@mdx-js/vue'
import HelloWorld from 'helloworld.md'

const components: {
  h1: props => ({
    render(h) {
      return (
        <h1 style={{ color: 'tomato' }} {...props} >
          {this.$slots.default}
        </h1>
      )
    }
  })
}

new Vue({
  el: '#app',
  render(h) {
    return (
      <MDXProvider components={components}>
        <HelloWorld />
      </MDXProvider>
    )
  }
}).$mount()

Yields:

<h1 style="color:tomato">Hello, Vue!</h1>

Contribute

See the Support and Contributing guidelines on the MDX website for ways to (get) help.

This project has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.

License

MIT © Compositor and Vercel

Current Tags

  • 1.6.8-ci.4                                ...           ci (6 months ago)
  • 1.6.22                                ...           latest (2 months ago)
  • 2.0.0-next.8                                ...           next (4 months ago)

86 Versions

  • 1.6.22                                ...           2 months ago
  • 1.6.21                                ...           3 months ago
  • 1.6.20                                ...           3 months ago
  • 1.6.19                                ...           3 months ago
  • 2.0.0-next.8                                ...           4 months ago
  • 1.6.18                                ...           4 months ago
  • 1.6.17                                ...           4 months ago
  • 2.0.0-next.7                                ...           6 months ago
  • 1.6.16                                ...           6 months ago
  • 1.6.15                                ...           6 months ago
  • 2.0.0-next.6                                ...           6 months ago
  • 2.0.0-next.5                                ...           6 months ago
  • 1.6.14                                ...           6 months ago
  • 2.0.0-next.4                                ...           6 months ago
  • 1.6.13                                ...           6 months ago
  • 1.6.12                                ...           6 months ago
  • 2.0.0-next.3                                ...           6 months ago
  • 1.6.11                                ...           6 months ago
  • 1.6.10                                ...           6 months ago
  • 1.6.9                                ...           6 months ago
  • 1.6.8                                ...           6 months ago
  • 1.6.8-ci.4                                ...           6 months ago
  • 1.6.7                                ...           6 months ago
  • 1.6.7-ci.4                                ...           6 months ago
  • 1.6.6                                ...           7 months ago
  • 1.6.5                                ...           8 months ago
  • 2.0.0-next.1                                ...           8 months ago
  • 1.6.4                                ...           8 months ago
  • 2.0.0-next.0                                ...           8 months ago
  • 1.6.3                                ...           8 months ago
  • 1.6.2                                ...           8 months ago
  • 1.6.1                                ...           9 months ago
  • 1.5.10-ci.8                                ...           9 months ago
  • 1.6.0                                ...           9 months ago
  • 1.5.9                                ...           9 months ago
  • 1.5.8                                ...           10 months ago
  • 1.5.8-alpha.0                                ...           a year ago
  • 1.5.7                                ...           a year ago
  • 1.5.7-alpha.0                                ...           a year ago
  • 1.5.6                                ...           a year ago
  • 1.5.6-alpha.0                                ...           a year ago
  • 1.5.6-ci.0                                ...           a year ago
  • 1.5.5                                ...           a year ago
  • 1.5.4                                ...           a year ago
  • 1.5.3                                ...           a year ago
  • 1.5.2                                ...           a year ago
  • 1.5.1                                ...           a year ago
  • 1.5.0                                ...           a year ago
  • 1.4.5                                ...           a year ago
  • 1.4.4                                ...           a year ago
  • 1.4.3                                ...           a year ago
  • 1.4.2                                ...           a year ago
  • 1.4.1                                ...           a year ago
  • 1.4.0                                ...           a year ago
  • 1.3.2                                ...           a year ago
  • 1.3.1                                ...           a year ago
  • 1.3.0                                ...           a year ago
  • 1.2.2                                ...           a year ago
  • 1.2.1                                ...           a year ago
  • 1.2.0                                ...           a year ago
  • 1.1.6                                ...           a year ago
  • 1.1.5                                ...           a year ago
  • 1.1.4                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 1.1.2-ci.2                                ...           a year ago
  • 1.1.1                                ...           a year ago
  • 1.1.1-ci.5                                ...           2 years ago
  • 1.1.1-ci.4                                ...           2 years ago
  • 1.1.1-ci.1                                ...           2 years ago
  • 1.0.28-ci.5                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.26                                ...           2 years ago
  • 1.0.23                                ...           2 years ago
  • 1.0.20-ci.12                                ...           2 years ago
  • 1.0.20                                ...           2 years ago
  • 1.0.20-ci.1                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0-rc.0                                ...           2 years ago
  • 1.0.0-alpha.13                                ...           2 years ago
  • 1.0.0-alpha.8                                ...           2 years ago
  • 1.0.0-alpha.6                                ...           2 years ago
  • 1.0.0-alpha.5                                ...           2 years ago
  • 1.0.0-alpha.4                                ...           2 years ago
  • 1.0.0-alpha.3                                ...           2 years ago
  • 1.0.0-alpha.2                                ...           2 years ago
Downloads
Today 0
This Week 8
This Month 20
Last Day 1
Last Week 7
Last Month 93
Dependencies (0)
None
Dev Dependencies (5)

Copyright 2014 - 2017 © taobao.org |