export default {} doesn't work



  • Hi all,
    I’m trying to create my first vue component, as from documentation, i’m using quasar-cli for quick creation of the component, and importing it in the page i want to use it ( so no global inport).

    The problem is that babel spits a warning like this:
    "export ‘EptsUserList’ was not found in '…/components/userList’
    and in my component i’ve:

    <template>
    <q-table title=“Users” :data=“tableData” :columns=“columns” row-key=“name”/>
    </template>

    <script>
    export default {
    name: ‘EptsUserList’,
    props: {},
    data () {
    return {
    columns: [],
    tableData:[]
    }
    }
    }
    </script>
    in my page i do simply (i’m putting just the code for the <script></script> tag):

    import { EptsUserList } from ‘…/components/userList’

    export default {
    name: ‘PageUsersList’,
    components: {
    EptsUserList
    }
    }

    where i’m doing it wrong?



  • Without seeing the source of “…/components/userList” I would try two things (1) verify that the path to userList within the components folder is correct and (2) change “import { EptsUserList } from …” to “import EptsUserList from …” (remove the {}).



  • It lives! thanks!!