1.安装cnpminstallmathjs--save2。Import*asmathfrom'mathjs'intomain.js//新版本需要这样引入。感谢您在评论区指出Vue。prototype.$math=math3,usethis.$math.round(3.1415926,3)//roundtokeep3decimalplaces4,usethedocumentationhttps://mathjs.org/docs/refer...有问题withlocaldebugging没问题发布到网上后,会报错UncaughtSyntaxError:In"GeV^-2","^"mustbefollowedbyafloating-pointnumber解决方法:fixedversion"mathjs":"8.1.0"
