Expose Vue component names for devtools (#1512)
* Expose name on host component for Vue devtools * Add changeset * Update changeset to patch from minor * [ci] collect stats * [ci] collect stats Co-authored-by: leviceccato <leviceccato@users.noreply.github.com> Co-authored-by: Matthew Phillips <matthew@matthewphillips.info>
This commit is contained in:
parent
32dbf68247
commit
31d0688016
3 changed files with 10 additions and 3 deletions
5
.changeset/slow-zoos-hide.md
Normal file
5
.changeset/slow-zoos-hide.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@astrojs/renderer-vue': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Expose name on host component for Vue devtools
|
|
@ -2,6 +2,8 @@ import { h, createSSRApp } from 'vue';
|
||||||
import StaticHtml from './static-html.js';
|
import StaticHtml from './static-html.js';
|
||||||
|
|
||||||
export default (element) => (Component, props, children) => {
|
export default (element) => (Component, props, children) => {
|
||||||
const app = createSSRApp({ render: () => h(Component, props, { default: () => h(StaticHtml, { value: children }) }) });
|
// Expose name on host component for Vue devtools
|
||||||
|
const name = Component.name ? `${Component.name} Host` : undefined;
|
||||||
|
const app = createSSRApp({ name, render: () => h(Component, props, { default: () => h(StaticHtml, { value: children }) }) });
|
||||||
app.mount(element, true);
|
app.mount(element, true);
|
||||||
};
|
};
|
||||||
|
|
|
@ -40,5 +40,5 @@ Date,Commits (24hr),Issues (24hr),Issues:BUG (24hr),Issues:RFC (24hr),Issues:DOC
|
||||||
"Sunday, October 10, 2021",6,0,0,0,0,3,19,195,11,54,33,15,"2021-10-10T12:05:25.390Z"
|
"Sunday, October 10, 2021",6,0,0,0,0,3,19,195,11,54,33,15,"2021-10-10T12:05:25.390Z"
|
||||||
"Monday, October 11, 2021",3,1,1,0,0,2,18,195,12,54,33,15,"2021-10-11T12:06:07.437Z"
|
"Monday, October 11, 2021",3,1,1,0,0,2,18,195,12,54,33,15,"2021-10-11T12:06:07.437Z"
|
||||||
"Tuesday, October 12, 2021",7,3,3,0,0,6,19,197,15,54,33,14,"2021-10-12T12:05:36.457Z"
|
"Tuesday, October 12, 2021",7,3,3,0,0,6,19,197,15,54,33,14,"2021-10-12T12:05:36.457Z"
|
||||||
"Wednesday, October 13, 2021",15,5,4,0,0,3,8,199,18,53,32,15,"2021-10-13T12:07:05.775Z"
|
"Wednesday, October 13, 2021",16,5,4,0,0,3,8,199,18,53,32,15,"2021-10-13T12:15:38.734Z"
|
||||||
"Thursday, October 14, 2021",7,2,2,0,0,6,8,201,20,53,32,15,"2021-10-14T12:05:35.253Z"
|
"Thursday, October 14, 2021",8,3,3,0,0,6,7,202,21,53,32,15,"2021-10-14T12:15:34.689Z"
|
||||||
|
|
|
Loading…
Reference in a new issue