sweet-modal-vue
sweet-modal-vue copied to clipboard
Include typings to make it work with Vue & Typescript
trafficstars
Currently, this component doesn't work when using Vue with Typescript. It would be awesome if you could include typings.
That would nice, indeed. Does anyone know for a quick fix? I'm getting a warning when using this.$refs.modal.open() :
Property 'open' does not exist on type 'Vue | Element | Vue[] | Element[]'.
Probably some module declaration in index.d.ts?
For anyone looking for a quick fix, just create a definition file with the following:
// types/sweetmodal.d.ts
declare module "sweet-modal-vue/src/plugin.js" {
import { PluginObject } from "vue";
const SweetModal: PluginObject<{}>;
export default SweetModal;
}