在vue+typescript中怎么使用vue-video-player?

问题描述

在vue+typescript中怎么使用vue-video-player?

问题出现的环境背景及自己尝试过哪些方法

按照官网安装vue-video-player,结果在页面中引入的时候,报错
Could not find a declaration file for module 'vue-video-player'. '/Users/wangjie/Desktop/skyeye/node_modules/_vue-video-player@5.0.2@vue-video-player/dist/vue-video-player.js' implicitly has an 'any' type.
Try npm install @types/vue-video-player if it exists or add a new declaration (.d.ts) file containing declare module 'vue-video-player';

然后执行npm install @types/vue-video-player,报错

npm ERR! code E404
npm ERR! 404 Not Found: @types/vue-video-player@latest

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/wangjie/.npm/_logs/2018-10-22T12_27_17_681Z-debug.log

对typeScript不是很熟悉,求指导!!

阅读 7.9k
3 个回答
declare module "vue-video-player";

这个库可能没有提供.d.ts 可能需要你自己写一下

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题