Vue-material: [MdTable] md-table-empty-state appears even when the table is populated.

Created on 20 Mar 2018  路  25Comments  路  Source: vuematerial/vue-material

Steps to reproduce

  1. Currently using vue 2.5.13, vue-material 1.0.0-beta-8, vuex 3.0.1
  2. Create an md-table populated via vuex (code below) that includes an md-table-empty-state
  3. Scroll to the bottom of the page
  4. Despite there being data, the md-table-empty-state appears

Which browser?

Currently testing on OSX, Chrome 65.

What is expected?

The md-table-empty-state should only appear when there's no data.

What is actually happening?

The md-table-empty-state is always happening

Reproduction Link

https://codesandbox.io/s/y2wyporwr9

Edit: Reproduction repo here: https://github.com/mattgrande/md-empty-state-reproduce

bug

Most helpful comment

@mattgrande As you can see i found a solution for a issue, do you think you can try it? If works for you, i merge it to dev.

To test it you can update your local dist file at line https://github.com/vuematerial/vue-material/blob/dev/dist/vue-material.js#L27023 or use my PR and compile your local version.

From:
_vm.value ? _vm._t("default") : _vm._e()
To:
!_vm.hasValue ? _vm._t("default") : _vm._e()

All 25 comments

Hey, we found out its not issue in vue-material but in codesandbox compiler. We are solving it with codesandbox devs. Thanks for issue!

For example here on Codepen it works: https://codepen.io/anon/pen/OvpyZL

So... I'm seeing it locally, which is why I opened the issue in the first place. So if you find out what the difference is between codesandbox and codepen, can you let me know?

@mattgrande depends on what version you using of vue, vue-template-compiler and vue-loader

My current dependencies:

"axios": "0.18.0",
"register-service-worker": "^1.0.0",
"vue": "^2.5.13",
"vue-class-component": "^6.0.0",
"vue-material": "1.0.0-beta-8",
"vue-property-decorator": "^6.0.0",
"vue-router": "^3.0.1",
"vuex": "^3.0.1"

Do you see anything amiss there?

Can you check vue-template-compiler and vue-loader?

vue-template-compiler is at 2.5.15 and vue-loader is 14.2.1.

We using vue-loader 13.7.0. maybe thats the issue

@mattgrande What template you using from vue-cli?

vue-loader for me is coming in as a dependency of vue/cli-service, which I have at 3.0.0-beta.6 (the latest).

My template uses the following: vue-router, vuex, sass, babel, typescript, pwa, unit-mocha, e2e-nightwatch.

Edit: Just noticed it's not in the list, but I also chose to use vue-class-component and vue-property-decorator, as well, which may be causing issues.

I'm going to try upgrading all of my dependencies, see if that helps.

(Oh, and thank you for your help thus far!)

Or it can depends on node version?

I'm on node 8.10.0 currently.

Edit: Updated my local packages to the latest everything; Still the same issue. Will try upgrading node I guess.

Same issue with node 9.8.0 as well :/

I'll try and create a repo that duplicates this afternoon so you can see what I see.

@mattgrande do you tried to remove package-lock and node_modules?

I have, yes. (Well, yarn.lock, but same idea)

Hey @mattgrande, could you maybe open up a temporary github repo with the reproducible example so we can test it locally with the same dependencies? This is a really interesting case.

Yeah, I will try and do that tonight; Maybe tomorrow, though.

Until we resolve it you can use this simple hack v-if="roles.length === 0" on md-table-empty-state.

I still can not reproduce it with new webpack environment with module version from yours.

Reproduce case: https://github.com/mattgrande/md-empty-state-reproduce

Let me know what I'm doing wrong :)

Looks like mostly something is changed or fixed in new Vue version.

I just noticed on my first page, I said I was using 2.5.13, however in package.json it was ^2.5.13 and had actually resolved to 2.5.15; The reproduce repo is pinned to 2.5.16.

Coming from Angular, I can't believe how often Vue updates versions...

@mattgrande your installed version depends on package-lock file

@mattgrande As you can see i found a solution for a issue, do you think you can try it? If works for you, i merge it to dev.

To test it you can update your local dist file at line https://github.com/vuematerial/vue-material/blob/dev/dist/vue-material.js#L27023 or use my PR and compile your local version.

From:
_vm.value ? _vm._t("default") : _vm._e()
To:
!_vm.hasValue ? _vm._t("default") : _vm._e()

Hey @Samuell1 I'm happy to report this works! My only (very minor) concern is that the thead still appears; Is that intentional?

@mattgrande i think table head is intentional to show.

Thanks for helping me to test it!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lovepluskaka picture lovepluskaka  路  3Comments

tridcatij picture tridcatij  路  3Comments

maryleloisa picture maryleloisa  路  3Comments

Feduch picture Feduch  路  3Comments

Leshgan picture Leshgan  路  3Comments