跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • vue 中显示带有 latex 数学语法的 html 内容的方案
未分類
14 1 月 2021

vue 中显示带有 latex 数学语法的 html 内容的方案

vue 中显示带有 latex 数学语法的 html 内容的方案

資深大佬 : zxCoder 4

查了好多也没找到有效的做法

后台获取到的是一个字符串,是 html 格式,然后里面带有一些 latex 公式,例如

"Then, Mikaela will count and give you the number of pairs of vertices $$$(s, t)$$$ where $$$s in S$$$ and $$$t in T$$$ such that the simple path from $$$s$$$ to $$$t$$$ contains $$$v$$$.</p><p>Mikaela the Goddess is busy and will be available to answer at most $$$11,111$$$ questions.</p><p>This is your only chance. Your task is to determine the tree and report its edges.</p>" 

用 vue 的 v-html 可以直接展示 html,但是其中的 latex 公式不知道要怎么办,网上找的几种 mathjax 的方法都不好用而且很麻烦

大佬有話說 (2)

  • 資深大佬 : iConnect

    你试下 $nextTick 方法,一定要让数据加载完之后再让 mathjax 渲染 LaTeX,mathjax 提前渲染了这时 v-html 数据还没加载完就无效果了

  • 資深大佬 : XiaoxiaoPu

    找到一个应该可以用的 mathjax vue 封装 github.com/justforuse/vue-mathjax

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具