当前位置: 首页 > news >正文

海淀网站制作服务公司网址缩短

海淀网站制作服务公司,网址缩短,最近国家新闻,网页设计培训 机构现有需求为 将实验数据录入表格中,需要表格呈现物理公式,使用Mathjax在vue2中 进行呈现 1.安装 npm i --save mathjax-vue 2.全局注册(main.js中) import MathJax, { initMathJax, renderByMathjax } from mathjax-vuefunction onMathJaxReady() {const el document.getEl…

现有需求为 将实验数据录入表格中,需要表格呈现物理公式,使用Mathjax在vue2中 进行呈现

1.安装

npm i --save mathjax-vue

2.全局注册(main.js中)

import MathJax, { initMathJax, renderByMathjax } from 'mathjax-vue'function onMathJaxReady() {const el = document.getElementById('elementId');renderByMathjax(el).then(r => {});
}initMathJax({}, onMathJaxReady)// vue 2
Vue.use(MathJax)// vue3
createApp(App).use(MathJax)

  私有组件 

import { MathJax } from 'mathjax-vue'
// 必须先执行过initMathJax
export default {...components: {MathJax,},...
}

 不想插入组件

// 必须先执行过initMathJax
import { renderByMathjax } from 'mathjax-vue'renderByMathjax(document.getElementById('id1'))

在表格中如何使用

<template><!--测 信号电压及频率 表--><div><el-table :data="tableData" border><template v-for="(item, index)  in tableHeader"><el-table-column :key="item.key" :label="item.label" :prop="item.key" align="center" show-overflow-tooltip><template slot-scope="scope" slot="header"><div class="mathjaxDom">{{ item.label }}</div></template><template slot-scope="scope"><div>{{scope.row[item.key]}}</div></template></el-table-column></template></el-table></div>
</template>
<script>
import {renderByMathjax} from 'mathjax-vue';
import {log} from "video.js";export default {data() {return {tableHeader: [{key: 'signal',label: '待测信号'}, {key: 'MD',label: 'm(div)'},{key: 'Dy',label: `$\{D_y}(V/div)$`},{key: 'ND',label: 'n(div)'},{key: 'Dt',label: `$\{D_t}(s/div)$`},{key: 'Vp',label: `$\{V_p}=\{D_y}m(V)$`},{key: 'T',label: `$T=\{D_t}n(Hz)$`},],tableData: [{signal: '2V,50Hz', MD: '1', Dy: '2',ND:'3',Dt:'4',Vp:'5',T:'6' },{signal: '4V,1000Hz', MD: '1', Dy: '2',ND:'3',Dt:'4',Vp:'5',T:'6' },]}},mounted() {this.renderFormula();},methods: {// 填充公式renderFormula() {this.$nextTick(() => {renderByMathjax(document.getElementsByClassName('mathjaxDom'))});},}
}
</script><style lang="less" scoped></style>

 ps:渲染公式 需要先拿到对应的DOM元素

Mathjax语法总结

使用MathJax 3 渲染数学公式及在Vue中的使用

MathJax基本的使用方式

http://www.tj-hxxt.cn/news/129163.html

相关文章:

  • 白酒类网站模板徐州seo
  • 有一个网站自己做链接获取朋友位置优化资源配置
  • 朔州市政府门户网站郑州网站优化软件
  • 免费地方门户网站源码不能搜的超级恶心的关键词
  • 企业网站怎么做的高大上长沙互联网网站建设
  • 重庆忠县网站建设公司电话郑州今日头条
  • 中文网站什么意思长沙互联网网站建设
  • 佛山住房和城乡建设厅网站重庆seo俱乐部
  • 做网站抽奖系统友情链接举例
  • 广西优化网站推广专员是做什么的
  • 贵阳网站开发哪家好站长统计软件
  • 电商网站设计 页面转化率免费大数据查询平台
  • web程序员自己做网站网页分析报告案例
  • 公安机关网站规范化建设应用网页搜索引擎大全
  • 建网站需要什么程序平台推广方案模板
  • app 网站可以做的免费推广营销型网站定制
  • h5在哪个网站上做月饼营销软文
  • 用织梦做网站有什么公司会要常州网站建设优化
  • wordpress知更鸟 破解关键词优化推广公司排名
  • 企查查 天眼查优化大师绿色版
  • 学做网站 书公关服务
  • Java做新闻网站网站的开发流程
  • 如何做阿里巴巴国际网站北京已感染上千万人
  • 网站后台可视化编辑精准营销策略都有哪些
  • 2003建立虚拟网站网络营销专业介绍
  • 哪些网站可以做平面设计哪里可以学网络运营和推广
  • 网站建设 广州网站建设专业公司seo公司重庆
  • 网站内链建设网络媒体广告代理
  • 龙湾区网站制作公司如何开一个自己的网站
  • 小红书推广网站我要登录百度