Skip to content

Commit

Permalink
feat(vue3): display functional tag (#1698)
Browse files Browse the repository at this point in the history
  • Loading branch information
konpeki622 authored Feb 10, 2022
1 parent 27d2b50 commit 89688d5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/app-backend-vue3/src/components/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,15 @@ export class ComponentWalker {
hasChildren: !!children.length,
children: [],
isFragment: isFragment(instance),
tags: [],
tags: typeof instance.type !== 'function'
? []
: [
{
label: 'functional',
textColor: 0x555555,
backgroundColor: 0xeeeeee,
},
],
}

// capture children
Expand Down
3 changes: 3 additions & 0 deletions packages/shell-dev-vue3/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Ghost from './Ghost.vue'
import Other from './Other.vue'
import SetupRender from './SetupRender.js'
import Form from './Form.vue'
import Functional from './Functional.vue'
import Heavy from './Heavy.vue'
import Mixins from './Mixins.vue'
import Animation from './Animation.vue'
Expand Down Expand Up @@ -42,6 +43,7 @@ export default {
Other,
SetupRender,
Form,
Functional,
Heavy,
Mixins,
Animation,
Expand Down Expand Up @@ -104,6 +106,7 @@ export default {
<Other />
<SetupRender />
<Form />
<Functional msg="I am functional" />
<Mixins />
<SetupScript />
<SetupDataLike />
Expand Down
14 changes: 14 additions & 0 deletions packages/shell-dev-vue3/src/Functional.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<script>
import { h } from 'vue'
const Functional = (props, context) => {
return h('div', context.attrs, props.msg)
}
Functional.props = {
msg: {
type: String,
},
}
export default Functional
</script>

0 comments on commit 89688d5

Please sign in to comment.