Tradingview widgets for Vue3. Demo
npm i vue-tradingview-widgets
or
yarn add vue-tradingview-widgets
<template>
<Chart />
<CryptoMarket />
<Snaps/>
<Screener/>
</template>
<script lang="ts">
import { Chart,CryptoMarket, Snaps, Screener } from 'vue-tradingview-widgets';
export default defineComponent({
name: 'App',
components: {
Chart,
CryptoMarket,
Screener,
Snaps,
},
});
</script>
All components have default options based on Tradingview. Check available options on Tradingview
<template>
<Chart
:options="{
theme: 'dark',
}"
/>
</template>
<script lang="ts">
import { Chart } from 'vue-tradingview-widgets';
export default defineComponent({
name: 'App',
components: {
Chart,
},
});
</script>
First import in /plugins/widgets.client.ts:
import Chart from 'vue-tradingview-widgets'
import Screener from 'vue-tradingview-widgets'
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(Chart)
nuxtApp.vueApp.use(Screener)
})
Then use in components. Plugin is auto-registered.