mathjax.js 312 B

123456789101112131415
  1. /* global MathJax */
  2. import App from '../base'
  3. export default App.directive('mathjax', function () {
  4. return {
  5. link(scope, element, attrs) {
  6. if (!(MathJax && MathJax.Hub)) return
  7. setTimeout(() => {
  8. MathJax.Hub.Queue(['Typeset', MathJax.Hub, element.get(0)])
  9. }, 0)
  10. },
  11. }
  12. })