element-plus / element-plus-nuxt-starter

🌰 A starter example for element-plus with Nuxt 3.
https://element-plus-nuxt.vercel.app
MIT License
299 stars 83 forks source link

Loading Component doesn't work #50

Closed RndUsername closed 1 year ago

RndUsername commented 2 years ago

for example:

<el-table v-loading="loading" :data="tableData" style="width: 100%">
  <el-table-column prop="date" label="Date" width="180" />
  <el-table-column prop="name" label="Name" width="180" />
  <el-table-column prop="address" label="Address" />
</el-table>

will cause this error:

[Vue warn]: Failed to resolve directive: loading
[nitro] [dev] [unhandledRejection] TypeError: Cannot read properties of undefined (reading 'getSSRProps')
    at Module.ssrGetDirectiveProps (C:\Users\kevin\Documents\.Meine Dokumente\Website Dev\element-plus-nuxt-starter\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:962:42)
    at _sfc_ssrRender (C:/Users/kevin/Documents/.Meine Dokumente/Website Dev/element-plus-nuxt-starter/components/Examples.vue:358:29)
    at renderComponentSubTree (C:\Users\kevin\Documents\.Meine Dokumente\Website Dev\element-plus-nuxt-starter\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:254:17)
    at renderComponentVNode (C:\Users\kevin\Documents\.Meine Dokumente\Website Dev\element-plus-nuxt-starter\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:188:16)
    at Module.ssrRenderComponent (C:\Users\kevin\Documents\.Meine Dokumente\Website Dev\element-plus-nuxt-starter\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:612:12)
    at _sfc_ssrRender (C:/Users/kevin/Documents/.Meine Dokumente/Website Dev/element-plus-nuxt-starter/pages/index.vue:17:31)        
    at renderComponentSubTree (C:\Users\kevin\Documents\.Meine Dokumente\Website Dev\element-plus-nuxt-starter\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:254:17)
    at renderComponentVNode (C:\Users\kevin\Documents\.Meine Dokumente\Website Dev\element-plus-nuxt-starter\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:188:16)
    at renderVNode (C:\Users\kevin\Documents\.Meine Dokumente\Website Dev\element-plus-nuxt-starter\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:299:22)
    at renderComponentSubTree (C:\Users\kevin\Documents\.Meine Dokumente\Website Dev\element-plus-nuxt-starter\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:263:13)

(but it works without the v-loading="loading" directive)

feAnnamari commented 2 years ago

I have the same problem, it seems v-loading doesn't work in ssr mode