Skip to content

Commit 33eeb70

Browse files
authored
Emphasizing the export and removing elementName.
1 parent 3f67508 commit 33eeb70

File tree

1 file changed

+7
-3
lines changed
  • 16/umbraco-cms/tutorials/creating-a-property-editor

1 file changed

+7
-3
lines changed

16/umbraco-cms/tutorials/creating-a-property-editor/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ At each step, you will find a dropdown for `suggestions-property-editor-ui.eleme
5353
"alias": "My.PropertyEditorUi.Suggestions",
5454
"name": "My Suggestions Property Editor UI",
5555
"element": "/App_Plugins/Suggestions/dist/suggestions.js",
56-
"elementName": "my-suggestions-property-editor-ui",
5756
"meta": {
5857
"label": "Suggestions",
5958
"icon": "icon-list",
@@ -89,7 +88,7 @@ import { LitElement, html, customElement, property } from '@umbraco-cms/backoffi
8988
import type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/property-editor';
9089

9190
@customElement('my-suggestions-property-editor-ui')
92-
export default class MySuggestionsPropertyEditorUIElement extends LitElement implements UmbPropertyEditorUiElement {
91+
export class MySuggestionsPropertyEditorUIElement extends LitElement implements UmbPropertyEditorUiElement {
9392
@property({ type: String })
9493
public value = '';
9594

@@ -98,6 +97,9 @@ export default class MySuggestionsPropertyEditorUIElement extends LitElement imp
9897
}
9998
}
10099

100+
101+
export default MySuggestionsPropertyEditorUIElement;
102+
101103
declare global {
102104
interface HTMLElementTagNameMap {
103105
'my-suggestions-property-editor-ui': MySuggestionsPropertyEditorUIElement;
@@ -106,7 +108,9 @@ declare global {
106108
```
107109
{% endcode %}
108110

109-
3. In the `vite.config.ts` file replace the `entry` to our newly created `.ts` file:
111+
3. Notice in above code the Element is exported as the `default`-export, in this way the system can pick up the Element.
112+
113+
4. In the `vite.config.ts` file replace the `entry` to our newly created `.ts` file:
110114

111115
```typescript
112116
entry: "src/suggestions-property-editor-ui.element.ts"

0 commit comments

Comments
 (0)