Skip to content

Weird "Vue is not defined" error ... #28

@lee-alderdice

Description

@lee-alderdice

Hi,

I am registering the component as per the docs and importing Vue as per my other components but getting the error "Error in created hook: "ReferenceError: Vue is not defined".

Below is the complete .vue file.

Any help greatly appreciated.

Thanks.

<template>
  <div>
    <datatable :columns="columns" :data="rows"></datatable>
  </div>
</template>

<script>
import Vue from "vue"
import DatatableFactory from "vuejs-datatable"
Vue.use(DatatableFactory)

export default {
  data () {
    return {
      columns: [
        {label: "id", field: "id"},
        {label: "Username", field: "user.username"},
        {label: "First Name", field: "user.first_name"},
        {label: "Last Name", field: "user.last_name"},
        {label: "Email", field: "user.email"},
        {label: "address",
          representedAs: function (row) {
            return row.address + "<br />" + row.city + ", " + row.state
          },
          interpolate: true
        }
      ],
      rows: [
        {
          "id": 1,
          "user": {
            "username": "dprice0",
            "first_name": "Daniel",
            "last_name": "Price",
            "email": "dprice0@blogs.com"
          },
          "address": "3 Toban Park",
          "city": "Pocatello",
          "state": "Idaho"
        }
      ]
    }
  }
}
</script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions