【发布时间】:2018-07-16 10:19:22
【问题描述】:
我不知道为什么,但是当我尝试打电话时
this.$refs.timeline.on('rangechange', function (start, end, byUser, event) {
console.log('timechanged...')
})
我每次Error: Invalid start "NaN"都会收到这个错误。
我在谷歌上搜索了解决方案,但一无所获。
以下是时间线选项:
timeline: {
stack: true,
start: new Date(),
end: new Date(1000 * 60 * 60 * 24 + (new Date()).valueOf()),
min: new Date(2018, 0, 1),
max: new Date(2019, 0, 1),
zoomMin: 1000 * 27 * 24 * 24, // if you want to zoom more in then lower the 27
zoomMax: 1000 * 60 * 60 * 24 * 31 * 3,
orientation: 'top'
}
我已经登录vis.js 脚本发生了什么。它开始记录开始和结束日期,然后它只是抛出error NaN。
这是出现错误的vis.js 脚本代码。
console.log('START', start)
console.log('END', end)
var newStart = start != null ? util.convert(start, 'Date').valueOf() : this.start,
newEnd = end != null ? util.convert(end, 'Date').valueOf() : this.end,
max = this.options.max != null ? util.convert(this.options.max, 'Date').valueOf() : null,
min = this.options.min != null ? util.convert(this.options.min, 'Date').valueOf() : null,
diff;
// check for valid number
if (isNaN(newStart) || newStart === null) {
throw new Error('Invalid start "' + start + '"');
}
if (isNaN(newEnd) || newEnd === null) {
throw new Error('Invalid end "' + end + '"');
}
有谁知道如何解决这个问题?谢谢。
【问题讨论】:
标签: javascript vue.js vuejs2 vis.js vis.js-timeline