mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
chore(examples): fix dynamic components example (#5294)
This commit is contained in:
parent
3ac01df488
commit
d9db45c287
@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -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",
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user