ankurk91 / vue-loading-overlay

Vue.js component for full screen loading indicator :cyclone:
https://ankurk91.github.io/vue-loading-overlay/
MIT License
1.24k stars 101 forks source link

Could not find a type declaration file  #49

Closed derweise closed 4 years ago

derweise commented 4 years ago

Hello at the import:

import Loading from 'vue-loading-overlay';

I am getting:

TS7016 Could not find a declaration file for module 'vue-loading-overlay'. '/Users/u2007750/cc/develop/projects/template/src/frontend/node_modules/vue-loading-overlay/dist/vue-loading.js' implicitly has an 'any' type.

Try npm install @types/vue-loading-overlay if it exists or add a new declaration (.d.ts) file containing declare module 'vue-loading-overlay';

ankurk91 commented 4 years ago

Hey, there is no support for typescript.

Coz i don't know this language.

You are free to submit a PR with type declaration.

ankurk91 commented 4 years ago

Ref https://github.com/ankurk91/vue-loading-overlay/issues/5

ankurk91 commented 4 years ago

Done, update to version 3.4.1

yingshaoxo commented 3 years ago

Done, update to version 3.4.1

ERROR in src/views/modules/account/offline/components/apply_information.vue:62:10
TS2614: Module '"../../../../../../node_modules/vue-loading-overlay/types/loading"' has no exported member 'useLoading'. Did you mean to use 'import useLoading from "../../../../../../node_modules/vue-loading-overlay/types/loading"' instead?

Missing type information

I suggest you export at least type of any, so it won't report any errors

ankurk91 commented 3 years ago

You can not import useLoading from the package, i have reverted the misleading documentation from readme unless I figure out the issue.

yingshaoxo commented 3 years ago

You can not import useLoading from the package, i have reverted the misleading documentation from readme unless if figure out the issue.

Despite of that, I'm pretty sure this library can't work with https://element-plus.org/#/en-US/component/card

It won't cover the UI created by element-plus

ankurk91 commented 3 years ago

I dont care if it does not work with element-plus card. If you want me to debug, report an issue with steps.

yingshaoxo commented 3 years ago

I dont care if it does not work with element-plus card. If you want me to debug, report an issue with steps.

You are the boss

Suddenly, I know where I got wrong.

I didn't import the css file: import "vue-loading-overlay/dist/vue-loading.css";


By the way, I made a repository for the testing. And I think it indeed does not work with the element card. But it's ok if we put it into a div.

If you still interested in make it workable under the element plus-card, check this: https://github.com/yingshaoxo/typescript-elementplus-vue-loading-overlay-example


Thanks for your amazing work!

yingshaoxo commented 3 years ago

I dont care if it does not work with element-plus card. If you want me to debug, report an issue with steps.

You are the boss

Suddenly, I know where I got wrong.

I didn't import the css file: import "vue-loading-overlay/dist/vue-loading.css";

By the way, I made a repository for the testing. And I think it indeed does not work with the element card. But it's ok if we put it into a div.

If you still interested in make it workable under the element plus-card, check this: https://github.com/yingshaoxo/typescript-elementplus-vue-loading-overlay-example

Thanks for your amazing work!

NO, I guess it does even not work under the div if we cancel the full screen option...

ankurk91 commented 3 years ago

Thanks for the example repo, i will look into it.

ankurk91 commented 3 years ago

i have figured out the issue with your example - i think you did not read the docs properly.

My readme has this line:

^When is-full-page is set to false, the container element should be positioned as position: relative. You can use CSS helper class vld-parent
<template>
  <div>
-    <el-card class="box-card">
+    <el-card class="box-card vld-parent">

You need to update your code as above

yingshaoxo commented 3 years ago
 vld-parent

Alright, you did a good job here.

I'm going to do a test with it.