1.1.0 • Published 5 years ago
mdx-js-vue3
Licence
MIT
Version
1.1.0
Deps
0
Size
1.3 MB
Vulns
0
Weekly
0
@mdx-js/vue
[![Build][build-badge]][build] [![Downloads][downloads-badge]][downloads] [![Sponsors][sponsors-badge]][opencollective] [![Backers][backers-badge]][opencollective] [![Chat][chat-badge]][chat]
Vue renderer for [MDX][]: JSX in Markdown.
Install
[npm][]:
npm install mdx-js-vue3
[yarn][]:
yarn add mdx-js-vue3
Use
Say we have the following code in example.mdx:
# Hello, world! {1 + 1}
And our script, example.jsx:
import {MDXProvider} from 'mdx-js-vue3'
import Example from './example.mdx'
import {h} from 'vue'
const components = {
h1: {
render() {
return h('h1', {style: {color: 'tomato'}}, this.$slots.default())
}
}
}