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 () => { export default {
VueChart = await VueChart extends: Bar,
return VueChart.Bar.extend({
props: ['data'], props: ['data'],
mounted() { mounted() {
this.renderChart(this.data) this.renderChart(this.data)
} }
})
} }

View File

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

View File

@ -16,7 +16,7 @@ const components = {
vText: () => import('@/components/text.vue' /* webpackChunkName: "components/text" */), vText: () => import('@/components/text.vue' /* webpackChunkName: "components/text" */),
vImage: () => import('@/components/image.vue' /* webpackChunkName: "components/image" */), vImage: () => import('@/components/image.vue' /* webpackChunkName: "components/image" */),
vCode: () => import('@/components/code.vue' /* webpackChunkName: "components/code" */), 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 { export default {

View File

@ -17,7 +17,7 @@ const components = {
vText: () => import('@/components/text.vue' /* webpackChunkName: "components/text" */), vText: () => import('@/components/text.vue' /* webpackChunkName: "components/text" */),
vImage: () => import('@/components/image.vue' /* webpackChunkName: "components/image" */), vImage: () => import('@/components/image.vue' /* webpackChunkName: "components/image" */),
vCode: () => import('@/components/code.vue' /* webpackChunkName: "components/code" */), 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 { export default {