feat: widget

This commit is contained in:
MoreStrive
2024-07-05 13:05:21 +07:00
parent a5f9ff7bac
commit a756c91bd0
8 changed files with 103 additions and 558 deletions
+8 -4
View File
@@ -45,7 +45,7 @@
const script = document.createElement('script');
script.id = props.SCRIPT_ID;
script.type = 'text/javascript';
script.async = true;
// script.async = true;
script.src = props.SCRIPT_SRC;
script.onload = onload;
document.getElementsByTagName('head')[0].appendChild(script);
@@ -60,11 +60,15 @@
onMounted(async () => {
await Object.assign(widgets, {
FireAnt: {
script: () => new window.FireAnt.MarketsWidget(Object.assign({ container_id: props.CONTAINER_ID }, props.options)),
script: () => new window.FireAnt.MarketsWidget({ container_id: props.CONTAINER_ID, ...props.options }),
key: window.FireAnt
}})
},
TradingView: {
script: () => new window.TradingView.widget({ container_id: props.CONTAINER_ID, ...props.options }),
key: window.TradingView
}
})
appendScript(initWidget(props.widgetKey));
// instance.proxy.$forceUpdate();
})
</script>
+33
View File
@@ -0,0 +1,33 @@
// <div class="tradingview-widget-container">
// <script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-ticker-tape.js" async>
// {
// "symbols": [
// {
// "proName": "FOREXCOM:SPXUSD",
// "title": "S&P 500 Index"
// },
// {
// "proName": "FOREXCOM:NSXUSD",
// "title": "US 100 Cash CFD"
// },
// {
// "proName": "FX_IDC:EURUSD",
// "title": "EUR to USD"
// },
// {
// "proName": "BITSTAMP:BTCUSD",
// "title": "Bitcoin"
// },
// {
// "proName": "BITSTAMP:ETHUSD",
// "title": "Ethereum"
// }
// ],
// "showSymbolLogo": true,
// "isTransparent": false,
// "displayMode": "adaptive",
// "colorTheme": "dark",
// "locale": "en"
// }
// </script>
// </div>