Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
428 views
in Technique[技术] by (71.8m points)

vue引用mathjs偶尔报错 ,再次刷新就没有了

math.js引用

//mathjs
const { create, all } = require('mathjs')
const config = {
  number:'BigNumber',
  precision:20  
}
const math = create(all,config);
Vue.prototype.$math = math;

实际代码

    methods: {
 all_of_ordering_total() {
                var aaa=this.$math.bignumber(this.fund_info.fund_networth);
                return aaa;
 },
 }

问题:打开页面第一次出现下面的报错信息,再次刷新又没有了,再次刷新又出现,再次刷新又消失了,不断循环。。

image.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

this.fund_info.fund_networth这个有问题,在data里面给fund_info初始化一下:

fund_info:{
    fund_networth: 0
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...