自定义创建button
这里需要用到TradingVeiw 提供的api
this_vue.chart.onChartReady(function() {
this_vue.chart.createButton()
.attr('title', 'test')
.attr('class','button')
.on('click', function (e) {
this_vue.chart.load(referenceChart2);
})
.append('<span>test</span>');
})
attr 定义标签属性
on 定义button的点击事件
append button的内容
文章来源: vue中使用TradingView --2