diff --git a/index.html b/index.html index 82d6043..5365544 100644 --- a/index.html +++ b/index.html @@ -20,6 +20,9 @@ + + + diff --git a/src/tradingview/index.tsx b/src/tradingview/index.tsx new file mode 100644 index 0000000..98020fd --- /dev/null +++ b/src/tradingview/index.tsx @@ -0,0 +1,22 @@ +import type { ResolutionString } from "#/datafeed-api"; + +export const TradingViewChart = defineComponent({ + name: "TradingViewChart", + setup(props, ctx) { + const chartContainer = ref(); + onMounted(() => { + // eslint-disable-next-line new-cap + const tradingView = new TradingView.widget({ + container: chartContainer.value!, + locale: "en", + library_path: "http://localhost:6173/charting_library/", + datafeed: new Datafeeds.UDFCompatibleDatafeed("https://demo-feed-data.tradingview.com"), + symbol: "AAPL", + interval: "1D" as ResolutionString, + debug: true, + }); + }); + + return () =>
; + }, +}); diff --git a/src/views/trade/index.vue b/src/views/trade/index.vue index cf3cb4a..222a090 100644 --- a/src/views/trade/index.vue +++ b/src/views/trade/index.vue @@ -1,11 +1,41 @@