chore(examples): fix dynamic components example (#5294)

This commit is contained in:
Dmitry Molotkov 2019-03-20 19:50:23 +03:00 committed by Pooya Parsa
parent 3ac01df488
commit d9db45c287
4 changed files with 11 additions and 14 deletions

View File

@ -1,12 +1,9 @@
let VueChart = import('vue-chartjs' /* webpackChunkName: "vue-chartjs" */)
import { Bar } from 'vue-chartjs'
export default async () => {
VueChart = await VueChart
return VueChart.Bar.extend({
export default {
extends: Bar,
props: ['data'],
mounted() {
this.renderChart(this.data)
}
})
}

View File

@ -1,9 +1,9 @@
{
"name": "example-dynamic-components",
"dependencies": {
"chart.js": "^2.7.0",
"chart.js": "^2.7.3",
"nuxt": "latest",
"vue-chartjs": "^2.8.7"
"vue-chartjs": "^3.4.2"
},
"scripts": {
"dev": "nuxt",

View File

@ -16,7 +16,7 @@ const components = {
vText: () => import('@/components/text.vue' /* webpackChunkName: "components/text" */),
vImage: () => import('@/components/image.vue' /* webpackChunkName: "components/image" */),
vCode: () => import('@/components/code.vue' /* webpackChunkName: "components/code" */),
vChart: () => import('@/components/chart.js' /* webpackChunkName: "components/chart" */).then(m => m.default())
vChart: () => import('@/components/chart.js' /* webpackChunkName: "components/chart" */)
}
export default {

View File

@ -17,7 +17,7 @@ const components = {
vText: () => import('@/components/text.vue' /* webpackChunkName: "components/text" */),
vImage: () => import('@/components/image.vue' /* webpackChunkName: "components/image" */),
vCode: () => import('@/components/code.vue' /* webpackChunkName: "components/code" */),
vChart: () => import('@/components/chart.js' /* webpackChunkName: "components/chart" */).then(m => m.default())
vChart: () => import('@/components/chart.js' /* webpackChunkName: "components/chart" */)
}
export default {