vue-2-3 icon indicating copy to clipboard operation
vue-2-3 copied to clipboard

feat: global component registration

Open Yubiao-Li opened this issue 3 years ago • 5 comments

when I use the component like this

// app.vue
<mp-block>
  <Test />
</mp-block>
// test.vue
<template>
  <mp-button>111</mp-button>
</template>

it didn't show normal and has warning that Failed to resolve component: mp-button , while I try to console.log(this) in test.vue, it show that it didn't register any components image

while I try console.log(app) in main.js , it seems normal, what happen??? image

Yubiao-Li avatar Apr 25 '21 11:04 Yubiao-Li

Thanks for the report @Yubiao-Li

Do you mind providing a reproduction via CodeSandbox or CodePen/JSFiddle?

privatenumber avatar Apr 26 '21 00:04 privatenumber

Thanks for the report @Yubiao-Li

Do you mind providing a reproduction via CodeSandbox or CodePen/JSFiddle?

https://codepen.io/Yubiao-Li/pen/bGgZZgy?editors=1111

Yubiao-Li avatar Apr 27 '21 07:04 Yubiao-Li

@privatenumber

Yubiao-Li avatar Apr 27 '21 11:04 Yubiao-Li

Ah it's not working because you registered components globally, which is currently not supported.

Changing it to local registration works: https://codepen.io/privatenumber/pen/jOyRVEz?editors=1111

Let's change this to a feature request to support global component registration

privatenumber avatar Apr 27 '21 18:04 privatenumber

Ah it's not working because you registered components globally, which is currently not supported.

Changing it to local registration works: https://codepen.io/privatenumber/pen/jOyRVEz?editors=1111

Let's change this to a feature request to support global component registration

@privatenumber Oh I don't know it can't support global component registration. Looking forward to your update

Yubiao-Li avatar Apr 28 '21 02:04 Yubiao-Li