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

    import js file into hello.vue

    Help
    4
    7
    3864
    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.
    • R
      rashidnk last edited by

      im not good in vue js, but i want to to use quasar for my project, please help me
      how to import a js file and use in hello.vue file

      here is my code

      // assets/alldata.js
      export default { allchapters: ‘20’, allmal: ‘30’ }

      // Components/hello.vue
      import Qdata from 'assets/alldata

      but im seeing a lot of errors in output

      0_1505976185168_Capture.PNG

      S 1 Reply Last reply Reply Quote 0
      • R
        rashidnk last edited by

        anyone ?

        1 Reply Last reply Reply Quote 0
        • S
          sonicviz last edited by

          You need to read and understand the lint errors, not ignore them.
          It’s quite restrictive and in most cases they are exactly what they say they are.

          1 Reply Last reply Reply Quote 0
          • R
            rashidnk last edited by

            you say this has error?
            export default { allchapters: ‘20’, allmal: ‘30’ }
            ??

            1 Reply Last reply Reply Quote 0
            • eleina
              eleina last edited by

              These are the ESLint errors. It says right there what it wants from you in the files. Such as:

              no-multiple-empty-lines -> this means you have more than one empty line in your code.
              no-multiple-spaces -> this means you have somewhere more than one space in your code.

              1 Reply Last reply Reply Quote 0
              • S
                Sujan Dev @rashidnk last edited by Sujan Dev

                @rashidnk you need to comment out the eslint rules to avoid error. go to webpack.base.conf.js file and do the following changes.

                module: {
                rules: [
                /* { // eslint
                enforce: ‘pre’,
                test: /.(vue|js)$/,
                loader: ‘eslint-loader’,
                include: projectRoot,
                exclude: /node_modules/,
                options: {
                formatter: require(‘eslint-friendly-formatter’)
                }
                }, */
                …keep all the rules as it is …
                ]
                }

                1 Reply Last reply Reply Quote 0
                • R
                  rashidnk last edited by

                  thank you, now it works

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