如何在 nativescript-vue 中呈现复杂的数学方程式?
How to render write complex mathematics equations in nativescript-vue?
有这个插件 (https://github.com/zzish/react-latex#readme) 在 React 中渲染 LaTex。有没有办法在 NativeScript-Vue 中使用类似的插件?
首先,这是一个 React 组件,而不是 ReactNative 组件。该组件是 Katex 的包装器,它将 LaTex 呈现为 HTML.
NativeScript-Vue 的一种使用方法是将 LaTex 渲染为 html 在 <WebView>
中渲染它,如下所示:
<template>
...
<WebView :src="exprHtml" height="100"/>
...
</template>
<script>
...
mounted() {
this.exprHtml = katex.renderToString("c = \pm\sqrt{a^2 + b^2}", {
throwOnError: false
});
}
</script>
您可以找到一个可用的 playground 示例 here。
请注意,<WebView>
组件就像添加到您的应用程序中的迷你浏览器。不要在一个屏幕上添加太多。
有这个插件 (https://github.com/zzish/react-latex#readme) 在 React 中渲染 LaTex。有没有办法在 NativeScript-Vue 中使用类似的插件?
首先,这是一个 React 组件,而不是 ReactNative 组件。该组件是 Katex 的包装器,它将 LaTex 呈现为 HTML.
NativeScript-Vue 的一种使用方法是将 LaTex 渲染为 html 在 <WebView>
中渲染它,如下所示:
<template>
...
<WebView :src="exprHtml" height="100"/>
...
</template>
<script>
...
mounted() {
this.exprHtml = katex.renderToString("c = \pm\sqrt{a^2 + b^2}", {
throwOnError: false
});
}
</script>
您可以找到一个可用的 playground 示例 here。
请注意,<WebView>
组件就像添加到您的应用程序中的迷你浏览器。不要在一个屏幕上添加太多。