Skip to content
Advertisement

Vue Showdown Default Classes

I want to achieve the following say i the MD as

JavaScript

I want to render it as

JavaScript

I was able to achieve this using VueShowdown

but I want add default class to every h1 tag like

JavaScript

I got something similar to this here.

But I don’t know how to use this in Vue.

Is it even possible in VueShowdown?

Is there any better library which has this functionality?

Advertisement

Answer

You can create a simple directive:

JavaScript

Then apply that directive to the VueShowdown component:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement