sweet-modal-vue icon indicating copy to clipboard operation
sweet-modal-vue copied to clipboard

Include typings to make it work with Vue & Typescript

Open marijngiesen opened this issue 8 years ago • 2 comments
trafficstars

Currently, this component doesn't work when using Vue with Typescript. It would be awesome if you could include typings.

marijngiesen avatar May 15 '17 12:05 marijngiesen

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?

davision avatar Apr 26 '19 12:04 davision

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;
}

vis97c avatar Jun 24 '21 03:06 vis97c