I am facing an issue while trying to import sortableJs/vuedraggable with a TS class component
.
Interestingly, when I utilize vuedraggable
with a regular JS standard component
, everything works smoothly.
Below is the code snippet showing vuedraggable with a standard JS component:
<script>
import draggable from "vuedraggable";
export default {
components: {
draggable
},
...
No errors are encountered in this scenario.
Now, let's take a look at vuedraggable implemented with a TS class component:
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import draggable from "vuedraggable";
@Component({
components: {
draggable
}
})
export default class Board extends Vue {
...
In this situation, an error surfaces.
The system could not locate a declaration file for module 'vuedraggable'.
It implicitly possesses an 'any' type. Try running
npm install @types/vuedraggable
if it exists or include a new declaration (.d.ts) file containing `declare module 'vuedraggable'
My attempted solution was as follows:
npm install @types/vuedraggable
npm ERR! 404 - '@types/vuedraggable@latest' is not found in the npm registry.
Any suggestions on how to effectively use vuedraggable in a Typescript Class Component?