madskristensen / VuePack2017

A Visual Studio extension
Other
37 stars 14 forks source link

How to import or extend component? #25

Closed vindberg closed 5 years ago

vindberg commented 5 years ago

How can I use the .vue components that I define in .vue files?

I have this chart component in a chart.vue:

<script>
    import { Bar } from 'vue-chartjs'

    export default {
        extends: Bar,
        data: () => ({
            chartdata: {
                labels: ['January', 'February'],
                datasets: [
                    {
                        label: 'Data One',
                        backgroundColor: '#f87979',
                        data: [40, 20]
                    }
                ]
            },
            options: {
                responsive: true,
                maintainAspectRatio: false
            }
        }),

        mounted() {
            this.renderChart(this.chartdata, this.options)
        }
    }

</script>

Thanks for any help. It difficult to google any guidance on this as its "building a components without a module packer"!!!.