Giter VIP home page Giter VIP logo

Comments (4)

ratiw avatar ratiw commented on August 14, 2024

@WolfDan Have you tried using full URL instead of /api/ladder/achievement?

from vuetable-2.

WolfDan avatar WolfDan commented on August 14, 2024

@ratiw Thanks for the answer, I try use full URL but sadly isn't working, if you like full log:

Uncaught TypeError: Cannot read property 'get' of undefined
    at VueComponent.loadData (eval at <anonymous> (main_pack.js:102), <anonymous>:306:55)
    at VueComponent.boundFn [as loadData] (vue.js:131)
    at VueComponent.created (eval at <anonymous> (main_pack.js:102), <anonymous>:214:12)
    at callHook (vue.js:2610)
    at VueComponent.Vue._init (vue.js:3364)
    at new VueComponent (vue.js:3483)
    at createComponentInstanceForVnode (vue.js:2761)
    at init (vue.js:2771)
    at createComponent (vue.js:4120)
    at createElm (vue.js:4063)
loadData @ Vuetable.vue?e64a:301
boundFn @ vue.js:131
created @ Vuetable.vue?e64a:214
callHook @ vue.js:2610
Vue._init @ vue.js:3364
VueComponent @ vue.js:3483
createComponentInstanceForVnode @ vue.js:2761
init @ vue.js:2771
createComponent @ vue.js:4120
createElm @ vue.js:4063
createChildren @ vue.js:4171
createElm @ vue.js:4096
createChildren @ vue.js:4171
createElm @ vue.js:4096
createChildren @ vue.js:4171
createElm @ vue.js:4096
createChildren @ vue.js:4171
createElm @ vue.js:4096
createChildren @ vue.js:4171
createElm @ vue.js:4096
patch @ vue.js:4552
Vue._update @ vue.js:2490
(anonymous) @ vue.js:2464
get @ vue.js:1663
Watcher @ vue.js:1655
Vue._mount @ vue.js:2463
Vue$3.$mount @ vue.js:6104
Vue$3.$mount @ vue.js:8494
initRender @ vue.js:3060
Vue._init @ vue.js:3365
Vue$3 @ vue.js:3412
(anonymous) @ script.js:33
vue.js:439 TypeError: Cannot read property '_updateFromParent' of undefined
    at prepatch (vue.js:2791)
    at patchVnode (vue.js:4385)
    at updateChildren (vue.js:4312)
    at patchVnode (vue.js:4396)
    at updateChildren (vue.js:4312)
    at patchVnode (vue.js:4396)
    at updateChildren (vue.js:4312)
    at patchVnode (vue.js:4396)
    at updateChildren (vue.js:4312)
    at patchVnode (vue.js:4396)

I was working with vue 1.0.28 and all was fine, but I update to vue 2 and it's the online plugin that don't work for me and I use it a lot hahahaha, I hope can be solved

from vuetable-2.

ratiw avatar ratiw commented on August 14, 2024

@WolfDan Everything is pointing to loadData(), but it's hard to say without really inspecting the code. By the way, have you import and register vue-resource? If not, the Vue.http might be undefined, therefore causing the error.

from vuetable-2.

WolfDan avatar WolfDan commented on August 14, 2024

I found the solution!

In my project I'm using axios for http request, so maybe when I compile Vue.http its undefined, so I copy the components and modify Vuetable.vue from this:

<script>
import Vue from 'vue'
import VueResource from 'vue-resource'
Vue.use(VueResource)

export default {

to this:

<script>
Vue.use(VueResource)

Also I have tested with axios and just do this:

<script>
import axios from 'axios' // if you use cnd so delete this 
Vue.prototype.$htpp = axios // this is you don't reference vue resource
Vue.http = axios //this if you reference vue resource
// don't import resource etc 

//other component code
loadData: function(success = this.loadSuccess, failed = this.loadFailed) {
      this.fireEvent('loading')

      this.httpOptions['params'] = this.getAllQueryParams()

      this.$http.get(this.apiUrl, this.httpOptions).then( //Vue.http to this.$http
        success,
        failed
      )
    },
    loadSuccess: function(response) {
      this.fireEvent('load-success', response)

      let body = this.transform(response.data) //replace body to data

      this.tableData = this.getObjectValue(body, this.dataPath, null)
      this.tablePagination = this.getObjectValue(body, this.paginationPath, null)

      if (this.tablePagination === null) {
        this.warn('vuetable: pagination-path "' + this.paginationPath + '" not found. '
          + 'It looks like the data returned from the sever does not have pagination information '
          + 'or you may have set it incorrectly.'
        )
      }

      this.$nextTick(function() {
        this.fireEvent('pagination-data', this.tablePagination)
        this.fireEvent('loaded')
      })
    },

In fact I don't know why don't work directly on npm package (I have VueResource in my npm too) I hope can be usefull for someone that has my same problem, also if like update the code to axios ^^

Thanks @ratiw for your time

from vuetable-2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.