We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
To use specific options "on the fly", you can proceed by altering temporary, the $md.options flags.
$md.options
Note : usage of $md.render require the usage of markdownit: { runtime: true } in nuxt.config.js
markdownit: { runtime: true }
nuxt.config.js
<template> <!-- eslint-disable-next-line vue/no-v-html --> <div v-html="rendered" /> </template> <script> export default { props: { markdown: { type: String, required: true }, options: { type: Object, default: null }, }, computed: { rendered() { const md = this.$md; let backupOptions; if (this.options) { // Backup initial preset backupOptions = Object.assign({}, md.options); // Overrides options with props ones Object.assign(md.options, this.options); } // Render const rendered = md.render(this.markdown); if (this.options) { // Restore backuped options md.options = backupOptions; } return rendered }, }, } </script>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
To use specific options "on the fly", you can proceed by altering temporary, the
$md.options
flags.The text was updated successfully, but these errors were encountered: