miaolz123 / vue-markdown

A Powerful and Highspeed Markdown Parser for Vue
https://miaolz123.github.io/vue-markdown/
MIT License
1.89k stars 257 forks source link

Is it possible to change default prop values for all my components on import? #74

Open lucassimines opened 5 years ago

lucassimines commented 5 years ago

I would like to set emoji: false globally.

mcdoyaji commented 5 years ago

Interesting.. Vue supply that kind of operation.

Vue.component(name, options) see here

This register component as global and also set component's default option.

gsmetal commented 5 years ago

I've implemented it like this:

import VueMarkdown from 'vue-markdown';
VueMarkdown.props.html.default = false;
VueMarkdown.props.anchorAttributes.default = () => ({ target: '_blank' });
Vue.component('vue-markdown', VueMarkdown);