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

使用官网component组件形式的例子 提示组件没注册 #323

Open
xd15332538931 opened this issue Apr 12, 2024 · 4 comments
Open

Comments

@xd15332538931
Copy link

我通过 import { component as Viewer} from 'v-viewer' 引入 提示 Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option. 这是怎么回事

@mirari
Copy link
Owner

mirari commented Apr 12, 2024

import以后是否在当前组件的components里注册了Viewer组件

components: {
      Viewer,
    },

@xd15332538931
Copy link
Author

xd15332538931 commented Apr 12, 2024

{{scope.options}} Show
<script> import 'viewerjs/dist/viewer.css' import { component as Viewer } from "v-viewer" export default { components: { Viewer, }, data() { return { images: [ "https://picsum.photos/200/200", "https://picsum.photos/300/200", "https://picsum.photos/250/200" ] } }, methods: { inited (viewer) { this.$viewer = viewer }, show () { this.$viewer.show() } } } </script> 我再vue2中使用你github上提供的component 例子 报错

Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

@xd15332538931
Copy link
Author

{{scope.options}} Show
<script> import 'viewerjs/dist/viewer.css' import { component as Viewer } from "v-viewer" export default { components: { Viewer, }, data() { return { images: [ "https://picsum.photos/200/200", "https://picsum.photos/300/200", "https://picsum.photos/250/200" ] } },
</script>
我再vue2中 这样引入还是 提示 Unknown custom element: <viewer> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

@mirari
Copy link
Owner

mirari commented Apr 15, 2024

无法复现,线上例子单独引入component也没有问题
https://codepen.io/mirari/pen/PowNyEY

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

2 participants