vue.js - 将变量传递给 vue 中的 props 选项
问题描述
我正在使用这个插件在我的网站中嵌入交易视图图表
以下是我的代码:
<div class="chart">
<template>
<div class="hello">
<VueTradingView style="height: 250px;" :options="{
autosize: true,
symbol: [this.tvmarket],
interval: '15',
timezone: 'Asia/Singapore',
theme: 'dark',
toolbar_bg: '#f1f3f6',
enable_publishing: false,
hide_side_toolbar: false,
allow_symbol_change: true,
show_popup_button: true,
}" />
</div>
</template>
</div>
该页面偶尔不会加载正确的符号。有时它可以解析变量“BINANCE:BTCUSDT”,但有时不能。如何正确地将变量传递给选项?
解决方案
尝试这个
<div class="chart">
<template>
<div class="hello">
<VueTradingView style="height: 250px;" :options="{
autosize: true,
symbol: tvmarket,
interval: '15',
timezone: 'Asia/Singapore',
theme: 'dark',
toolbar_bg: '#f1f3f6',
enable_publishing: false,
hide_side_toolbar: false,
allow_symbol_change: true,
show_popup_button: true,
}" />
</div>
</template>
</div>
推荐阅读
- mysql - 使用两个查询制作水平视图
- r - RCurl Post 不适用于 kerberos 身份验证和 SSL
- sql - SQL |如何将单个日期列拆分为 SQL 表中的两列
- django - 在 crontab 中运行 Django 管理命令
- javascript - 如何仅使用 CSS3 将动态创建的元素平滑地添加到 DOM?
- c++ - C++:如何创建一个接受串联字符串作为参数的函数?
- c - C中优先级队列插入函数中的SIGSEV错误
- mongodb - Docker - 使用 MongoDB 创建第一个用户
- excel - Visual Studio Excel 插件 - VB.Net - 帮助避免不同数据范围的 vb.Null 错误
- laravel - 你如何处理喜欢许多不同的模型?