mathjax3-vue
v0.0.18
Published
Vue2 and Vue3 components for MathJax3
Downloads
26
Maintainers
Readme
mathjax3-vue
This plugins implements the browser version of Mathjax v3 into vue.
Support vue2 and vue3
Click to view online example:online example
online
Install
yarn add mathjax3-vue
Use vue2
1.main.js config of MathJax3
import YyMathjax from 'mathjax3-vue'
const config={
tex: {
inlineMath: [['$', '$']],
processEscapes: true
}
}
Vue.use(YyMathjax,config)
2. App.vue
<template>
<div>
<yy-mathjax :latex="latexStr"></yy-mathjax>
<div>input:abc$\frac{2}{3}$def</div>
<textarea type='textarea' v-model='latexStr'/>
</div>
</template>
<script>
export default {
name: "App",
components: {
},
data(){
return {
latexStr:""
}
}
};
</script>
<style>
</style>
Use vue3
1.main.js config of MathJax3
import { createApp } from 'vue'
import App from './App.vue'
import YyMathjax from 'mathjax3-vue'
const config={
tex: {
inlineMath: [['$', '$']],
processEscapes: true
}
}
createApp(App).use(YyMathjax,config).mount('#app')
2. App.vue
<template>
<yy-mathjax :latex="latexStr"></yy-mathjax>
<div>input:abc$\frac{2}{3}$def</div>
<textarea type='textarea' v-model='latexStr'/>
</template>
<script>
export default {
name: "App",
components: {
},
data(){
return {
latexStr:""
}
}
};
</script>
<style>
</style>