Saigesp / vue-d3-charts

D3 charts for Vue
https://saigesp.github.io/vue-d3-charts/
GNU Lesser General Public License v2.1
97 stars 30 forks source link

export 'D3BarChart' was not found in 'vue-d3-charts' #5

Closed alukos closed 4 years ago

alukos commented 4 years ago

App.vue

<script>
import { D3BarChart } from 'vue-d3-charts'
...

Received: export 'D3BarChart' was not found in 'vue-d3-charts'

alukos commented 4 years ago

Can't run from /docsrc yarn dev

[Vue warn]: Unknown custom element: <D3SlopeChart> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

found in

---> <SlopeChartExampleDataUpdate> at src/components/examples/SlopeChartExampleDataUpdate.vue
       <HomeView> at src/views/Home.vue
         <App> at src/App.vue
           <Root>
warn @ vue.runtime.esm.js?2b0e:619
...
Saigesp commented 4 years ago

Sorry, I hadn't updated the npm repository yet. Try installing it again now

alukos commented 4 years ago

Thank you! Now docsrc works perfectly

➜  docsrc git:(master) ✗ npm list | grep vue-d3-charts
docs@0.1.0 /home/alukos/Projects/sandbox/vue/vue-d3-charts/docsrc
├─┬ vue-d3-charts@0.2.1

But nothing has changed in my nuxt app after reinstalling the module index.vue:

<template>
  <D3BarChart :config="config" :datum="data"></D3BarChart>
</template>

<script>
import { D3BarChart } from 'vue-d3-charts'

export default {
  components: { D3BarChart },
  ...
npm list | grep vue-d3-charts 
...
├─┬ vue-d3-charts@0.2.1
yarn dev
...
"export 'D3BarChart' was not found in 'vue-d3-charts'  
Saigesp commented 4 years ago

Ok, I've implemented vue-sfc-rollup instead of rollup.js and all seem to be fine now.

Check it out in version 0.2.3

As you said, also define the chart in components:

import { D3BarChart } from 'vue-d3-charts';

export default {
  name: 'LoremIpsumComponent',
  components: {
    D3BarChart,
  },
  // ...
};