Skip to content
This repository was archived by the owner on May 3, 2018. It is now read-only.
This repository was archived by the owner on May 3, 2018. It is now read-only.

Unreliable data passing to component. #173

Closed
@alchen

Description

@alchen

I have a few nested components in the following fashion: component (different lists) > component (the list) > component (list item), with a combination of v-component="{{ currentView }}" and v-repeat. I also passed down a few additional parameter using v-with (also tried paramAttributes) all the way from the top most layer to the bottom.

The problem is that sometimes I cannot access those parameters passed down from v-with. I have not isolated the source of the problem, and I will see if I can put them in jsfiddle's (or find out what I did wrong).

I have a method that uses a v-with variable username, and the following will both log undefined.

paramAttributes: ['username'],
methods: {
  doSomething: function () { console.log(this.username); console.log(this.$data.username); }
}

Unless I do either of theses:

  1. Add the following created to the component:

    created: function () {
      this.username = this.$data.username;
      this.now = this.$data.now;
    }
    

    This results in this.username === username and this.$data.username === undefined.

  2. Refresh. I don't really understand why it'd be different between a fresh load and a refresh, but the same problem doesn't appear in a refresh. Update: the refresh has nothing to do with the problem; the application was simply in a different state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions