MathJax 3 vue compontent for Nuxt.js with re-rendering.
Nuxt: 2.15.8
MathJax: 3.2.0
Just like that
<Math data="E=mc^{2}" />
Or make it dynamic!, change the display
<Math :data="data" display="inline" />
Name | Type | Values | Default | Description |
---|---|---|---|---|
data |
String, Boolean | — | false |
The content to display with MathJax 3 |
safe |
Boolean | true, false | true |
Render data as text (true) or html (false) |
display |
String | block, inline, or custom | block |
The display style of the component |
config |
Object | — | {} |
The configuration options for MathJax |
update |
Any | — | null |
Force a MathJax re-render with typeset |
source |
String | local, cdn | local |
The source of the MathJax library, local in static or cdn from web. |
file |
String | — | tex-mml-chtml |
The configuration file name of MathJax (component file). DON'T put .js |
# copy /mathjax/es5 to /static/mathjax/
$ npm copy
# copy /mathjax-full/es5 to /static/mathjax-full/
$ npm copy-full
# install dependencies
$ npm install
# serve with hot reload at localhost:3000
$ npm run dev
# build for production and launch server
$ npm run build
$ npm run start
# generate static project
$ npm run generate
For detailed explanation on how things work, check out Nuxt.js docs.