Skip to content

Problem with $slotOptions and dwonload button #9

Closed
@heitara

Description

@heitara

Hello,

I had some problem with the most recent version - "vue-xlsx": "^0.2.1"
The Download button is not appearing. I've updated the render function with this new one and it seems to be working.

render(h) {
    if (this.$slots.default && this.loaded) {
      return h(
        "div",
        {
          on: {
            click: this.disableWrapperClick ? () => {} : this.download
          }
        },
        [
          this.$slots.default
        ]
      );
    }
    return null;
  }

Here is the old function for comparison:

  render(h) {
    if (this.$scopedSlots.default && this.loaded) {
      return h(
        "div",
        {
          on: {
            click: this.disableWrapperClick ? () => {} : this.download
          }
        },
        [
          this.$scopedSlots.default({
            download: this.download
          })
        ]
      );
    }
    return null;
  }

I'm not sure why $scopedSlots. is undefined. Could you please adjust the code, so it works fine on [email protected]?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions