Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: 传统cdn引入vue-aplayer的文档有误 #351

Open
lzm0x219 opened this issue Jan 6, 2020 · 5 comments
Open

docs: 传统cdn引入vue-aplayer的文档有误 #351

lzm0x219 opened this issue Jan 6, 2020 · 5 comments

Comments

@lzm0x219
Copy link

lzm0x219 commented Jan 6, 2020

我确定的是2.x版本需要这样注册组件,1.x不确定,没这样用过。

Vue.use(VueAPlayer.default, {
  defaultCover: '',
  productionTip: true
});
@zhangyc310
Copy link

确实如此,唯有VueAPlayer.default才能正常加载。希望作者能更新一下文档。
vue player非常棒

@NeserCode
Copy link

不知道为什么,我使用:

Vue.use(APlayer, {
  defaultCover: 'https://github.com/u3u.png',
  productionTip: false,
});

创建倒是成功了,但是会一直报错:
[Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.
而且使用原生的API也会提示我的{media}没有定义,例如:

const { media } = this.$refs.aplayer;

console.log(media.currentTime); // 获取音频当前播放时间
console.log(media.duration); // 获取音频总时间
console.log(media.paused); // 获取音频是否暂停

错误i

希望能请作者完善一下这个,很好的作品。

上面两位老哥能否详细说明一下这个VueAPlayer.default是如何操作。
小白不胜感激。
@vvni @zhangyc310

@zhangsan08
Copy link

我确定的是2.x版本需要这样注册组件,1.x不确定,没这样用过。

Vue.use(VueAPlayer.default, {
  defaultCover: '',
  productionTip: true
});

求问怎么写

@zhangsan08
Copy link

确实如此,唯有VueAPlayer.default才能正常加载。希望作者能更新一下文档。 vue player非常棒

求问怎么写

@zhangsan08
Copy link

不知道为什么,我使用:

Vue.use(APlayer, {
  defaultCover: 'https://github.com/u3u.png',
  productionTip: false,
});

创建倒是成功了,但是会一直报错: [Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option. 而且使用原生的API也会提示我的{media}没有定义,例如:

const { media } = this.$refs.aplayer;

console.log(media.currentTime); // 获取音频当前播放时间
console.log(media.duration); // 获取音频总时间
console.log(media.paused); // 获取音频是否暂停

错误i

希望能请作者完善一下这个,很好的作品。

上面两位老哥能否详细说明一下这个VueAPlayer.default是如何操作。 小白不胜感激。 @vvni @zhangyc310

解决可吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants