import js file into hello.vue



  • 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



  • anyone ?



  • 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.



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



  • 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.



  • @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 …
    ]
    }



  • thank you, now it works


Log in to reply
 

Looks like your connection to Quasar Framework was lost, please wait while we try to reconnect.