mathlive: Unable to run mathlive for VueJS with package from node_module
Description
I still have this problem when i reproduce the example for VueJs
in main.js
import MathLive from 'mathlive/dist/mathlive';
import Mathfield from 'mathlive/dist/vue-mathlive.mjs';
Vue.use(Mathfield, MathLive);
In my math component
<mathlive-mathfield id="mf" ref="mathfield" :config="{smartFence:false}" v-on:focus="ping"
:on-keystroke="displayKeystroke" v-model="formula">f(x)=</mathlive-mathfield>
gives this error
TypeError: Cannot read property '0' of undefined
Environment
Operating System MacOS
Browser Chrome
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (7 by maintainers)
Hmmm… I think the warning at the top might be relevant: “You are using the runtime-only build of Vue…”. It appears that the element that the Mathfield builds on (
this.element
) is not an HTMLElement but some comment node (!?) Try including the Vue runtime with its compiler.