diff --git a/examples/vue-chartjs/README.md b/examples/vue-chartjs/README.md new file mode 100644 index 0000000000..ab534cf92a --- /dev/null +++ b/examples/vue-chartjs/README.md @@ -0,0 +1,3 @@ +# Vue-ChartJS with Nuxt.js + +https://nuxtjs.org/examples diff --git a/examples/vue-chartjs/components/bar-chart.js b/examples/vue-chartjs/components/bar-chart.js new file mode 100644 index 0000000000..137e0ed82a --- /dev/null +++ b/examples/vue-chartjs/components/bar-chart.js @@ -0,0 +1,8 @@ +import { Bar } from 'vue-chartjs' + +export default Bar.extend({ + props: ['data', 'options'], + mounted () { + this.renderChart(this.data, this.options) + } +}) diff --git a/examples/vue-chartjs/nuxt.config.js b/examples/vue-chartjs/nuxt.config.js new file mode 100644 index 0000000000..60acba1978 --- /dev/null +++ b/examples/vue-chartjs/nuxt.config.js @@ -0,0 +1,5 @@ +module.exports = { + build: { + vendor: ['axios', 'moment', 'chart.js', 'vue-chartjs'] + } +} diff --git a/examples/vue-chartjs/package.json b/examples/vue-chartjs/package.json new file mode 100644 index 0000000000..e35aa226e2 --- /dev/null +++ b/examples/vue-chartjs/package.json @@ -0,0 +1,15 @@ +{ + "name": "hello-nuxt", + "dependencies": { + "axios": "^0.16.2", + "chart.js": "^2.6.0", + "moment": "^2.18.1", + "nuxt": "latest", + "vue-chartjs": "^2.8.2" + }, + "scripts": { + "dev": "nuxt", + "build": "nuxt build", + "start": "nuxt" + } +} diff --git a/examples/vue-chartjs/pages/index.vue b/examples/vue-chartjs/pages/index.vue new file mode 100755 index 0000000000..21ee6f0d61 --- /dev/null +++ b/examples/vue-chartjs/pages/index.vue @@ -0,0 +1,42 @@ + + + + +