-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(#296): removed functional components
- Loading branch information
1 parent
1fbbd72
commit 2b56ebe
Showing
16 changed files
with
142 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
<template functional> | ||
<template> | ||
<hr class="t3-ce-div"> | ||
</template> | ||
<script> | ||
export default { | ||
name: 'T3CeDiv', | ||
functional: true | ||
name: 'T3CeDiv' | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,40 @@ | ||
<template> | ||
<ul> | ||
<li | ||
v-for="child in children" | ||
:key="child.id" | ||
> | ||
<t3-nav-link | ||
:to="child.link" | ||
:attrs="{ | ||
target: child.target || false, | ||
title: child.title | ||
}" | ||
> | ||
{{ child.title }} | ||
</t3-nav-link> | ||
<T3CeMenuPagesList | ||
v-if="child.children" | ||
:children="child.children" | ||
/> | ||
</li> | ||
</ul> | ||
</template> | ||
|
||
<script> | ||
import T3CeMenuPagesList from './T3CeMenuPagesList.vue' | ||
// helper component to render nested list | ||
export default { | ||
functional: true, | ||
name: 'T3CeMenuPagesList', | ||
components: { | ||
T3CeMenuPagesList | ||
}, | ||
props: { | ||
children: { | ||
type: Array, | ||
required: true | ||
} | ||
}, | ||
render (createElement, ctx) { | ||
return createElement( | ||
'ul', | ||
ctx.props.children.map((el) => { | ||
return createElement('li', {}, [ | ||
createElement( | ||
'nav-link', | ||
{ | ||
props: { | ||
to: el.link | ||
}, | ||
attrs: { | ||
target: el.target || false, | ||
title: el.title | ||
} | ||
}, | ||
el.title | ||
), | ||
el.children | ||
? createElement('T3CeMenuPagesList', { | ||
props: { | ||
children: el.children | ||
} | ||
}) | ||
: false | ||
]) | ||
}) | ||
) | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,18 @@ | ||
<template> | ||
<div> | ||
<T3Renderer :shortcut="shortcut" /> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'T3CeShortcut', | ||
functional: true, | ||
props: { | ||
shortcut: { | ||
type: Array, | ||
required: true | ||
} | ||
}, | ||
render (createElement, ctx) { | ||
return createElement('div', [ | ||
createElement('t3-ce-renderer', { | ||
props: { | ||
content: ctx.props.shortcut | ||
} | ||
}) | ||
]) | ||
} | ||
} | ||
</script> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<template> | ||
<div | ||
class="t3-ce-frame" | ||
:class="computedClasses" | ||
v-bind="$attrs" | ||
> | ||
<slot /> | ||
</div> | ||
</template> | ||
|
||
<!-- Content element wrapper - Section Frame | ||
All props are returned from appearance --> | ||
<script> | ||
export default { | ||
name: 'T3Frame', | ||
props: { | ||
frameClass: { | ||
type: String, | ||
default: '' | ||
}, | ||
layout: { | ||
type: String, | ||
default: 'default' | ||
}, | ||
spaceAfter: { | ||
type: String, | ||
default: 'default' | ||
}, | ||
spaceBefore: { | ||
type: String, | ||
default: 'default' | ||
} | ||
}, | ||
computed: { | ||
computedClasses () { | ||
return [ | ||
`frame-${this.frameClass}`, | ||
`layout-${this.layout}`, | ||
`space-before-${ | ||
this.spaceBefore.length ? this.spaceBefore : 'default' | ||
}`, | ||
`space-after-${ | ||
this.spaceAfter.length ? this.spaceAfter : 'default' | ||
}` | ||
] | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { default } from './T3Frame.js' | ||
export { default } from './T3Frame.vue' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.