No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How to add "vue-echarts-v3" in Quasar CLI

    CLI
    2
    4
    1028
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      minko last edited by

      Hello !
      I want to add lib “vue-echarts-v3” to Quasar CLI project.

      What i have done :

      1. Installed “vue-echarts-v3” as “npm install --save echarts vue-echarts-v3”
      2. Edited “quasar.conf.js” as added "build: {
        scopeHoisting: true,
        extendWebpack (cfg) {
        })
        cfg.module.rules.push({
        test: /.js$/,
        loader: ‘babel-loader’,
        include: [resolve(‘src’), resolve(‘test’), resolve(‘node_modules/vue-echarts-v3/src’)]
        })
        }
        },
        "
      3. In vue module i added :
        “<script>
        import { QCard, QCardSection } from ‘quasar’
        import IEcharts from ‘vue-echarts-v3’
        …”

      "
      <template>
      <q-page class=“flex flex-center”>
      <img alt=“Quasar logo” src="~assets/quasar-logo-full.svg">
      <div name=“divchart” class=“echarts”>
      <i-echarts
      :option=“bar”
      :loading=“loading”
      @ready=“onReady”
      @click=“onClick”
      />
      …
      "

      When load the app in browser i look in Console and there have message
      "
      vue.runtime.esm.js?2b0e:619 [Vue warn]: Unknown custom element: <i-echarts> - did you register the component correctly? For recursive components, make sure to provide the “name” option.

      found in

      —> <PageIndex> at src/pages/Index.vue
      <QPageContainer>
      <QLayout>
      <MyLayout> at src/layouts/MyLayout.vue
      <App> at src/App.vue
      <Root>
      "

      I’m new in Vue, and i cant understood why IECharts are not visible/reachable.

      Can somebody help me, please !

      gvorster 1 Reply Last reply Reply Quote 1
      • M
        minko last edited by

        Resolved - а spelling error for “componets” instead of “components”

        1 Reply Last reply Reply Quote 1
        • gvorster
          gvorster @minko last edited by

          @minko Can you post your quasar.config.js ?

          I am getting error

          ReferenceError: resolve is not defined
          

          After adding

          cfg.module.rules.push({
                    test: /\.js$/,
                    loader: 'babel-loader',
                   include: [resolve('src'), resolve('test'), resolve('node_modules/vue-echarts-v3/src')]
                  })
          
          1 Reply Last reply Reply Quote 1
          • gvorster
            gvorster last edited by

            Ok, I looked at https://github.com/pratik227/echarts-quasar and didn’t have to add anything in quasar.conf.js
            It just works.

            1 Reply Last reply Reply Quote 1
            • First post
              Last post