question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hey guys, I’m in love with this library. Its super cool and easy to use. I use Vue in my day job, and I would really love to be able to write some component docs with this, because as far as I know - there is nothing in the Vue world for this, even though we have JSX.

I think its because of the differences that Vue needs, in comparison to being able to define a functional React component that makes it slightly non-trivial? I’m rusty with my parsers, so not sure how another layer of abstraction ontop of parsing with deciding to use a JSX outputter is.

i.e.

export default {
  render() {
    return <div>Hello World</div>;
  }
};

in comparison to:

const MyComponent = () => <div>Hello World</div>

I miss React. 😃 Would love to understand whether it was possible or not.

Thanks guys!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:11
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

9reactions
brennjcommented, Aug 26, 2018
screen shot 2018-08-26 at 23 18 33

The markdown file:

import Test from './Test.vue';

# Hello World!

This is great!
_No React here!_

<Test />

Really enjoyed this! Surprised it works!!

I’m exhausted so won’t get the PR just today - will do during the week, but basically the API I have proposed will look like this:

const { VueJSXCompiler } = require('@mdx-js/vue-plugin-mdx');
....
    module: {
      rules: [
        ...
        {
          test: /.mdx?$/,
          use: ['babel-loader', {
            loader: '@mdx-js/loader',
            options: {
              compilers: [VueJSXCompiler]
            }
          }],
        }
      ]
    }

So it means that a new package called @mdx-js/vue-plugin-mdx would be added. Theres also some knowledge of it in the loader in order to know whether to render Vue stuff or React stuff.

I’ll need to look at the code with fresh eyes during the week before I open the PR. I’m sure I’ve duplicated one too many things.

3reactions
codebender828commented, Jun 27, 2020

Hey @calaoa ! Yes it’s possible to consume Vue components in your MDX files. You’d need to consume it as JSX in your MDX file.

Here’s an example of how consume Vue components in MDX files.

(This is an old demo but works. I made this when I was working on adding support for Vue.js. All functionality is already added to the MDX package.) Demo: https://mdx-vue.now.sh/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Contact Pearson VUE
There are many ways to contact Pearson VUE. This page lists all of the ways to contact us so that your question can...
Read more >
Vue.js - The Progressive JavaScript Framework | Vue.js
Builds on top of standard HTML, CSS and JavaScript with intuitive API and world-class documentation. Performant. Truly reactive, compiler-optimized rendering ...
Read more >
Contact us | FAQs | Vue Cinemas
Our Vue Customer Services team are available daily between 9:00 am and 7:00 pm. Got a query or need to contact us? Just...
Read more >
Getting Started - Vite
The default build targets browsers that support native ES Modules, native ESM dynamic ... npm 6.x npm create vite@latest my-vue-app --template vue #...
Read more >
Direct support from Vuetify
Vuetify is a Material Design component framework for Vue.js. ... and other Core Team members are now offering Support Services for your Vuetify...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found