umbraco-property-editor-ui by umbraco/umbraco-cms-backoffice-skills
npx skills add https://github.com/umbraco/umbraco-cms-backoffice-skills --skill umbraco-property-editor-ui属性编辑器 UI 是用户在 Umbraco 后台中与之交互的可视化组件,用于输入和管理内容数据。它是属性编辑器的一半——UI(客户端 TypeScript)与定义数据存储的 Schema(服务器端 C#)配对使用。
在实现之前,请务必获取最新文档:
Umbraco 源代码包含一个可运行的示例:
位置 : /Umbraco-CMS/src/Umbraco.Web.UI.Client/examples/property-editor/
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
此示例演示了一个完整的、带有配置的属性编辑器 UI 实现。请研究此示例以了解生产模式。
Umbraco 元素 : 当使用 UmbElementMixin 实现 UI 元素时
umbraco-umbraco-element状态管理 : 当实现响应式值更新时
umbraco-state-management本地化 : 当为标签添加多语言支持时
umbraco-localization警告: 下面的
propertyEditorSchemaAlias使用了内置的 schemaUmbraco.Plain.String。如果你使用自定义别名,如MyPackage.CustomSchema,你必须在服务器端有一个对应的 C#DataEditor类,否则在创建数据类型时会收到 404 错误。
{
"name": "My Property Editor",
"extensions": [
{
"type": "propertyEditorUi",
"alias": "My.PropertyEditorUi.Custom",
"name": "My Custom Editor",
"element": "/App_Plugins/MyEditor/editor.js",
"elementName": "my-editor-ui",
"meta": {
"label": "My Custom Editor",
"icon": "icon-edit",
"group": "common",
"propertyEditorSchemaAlias": "Umbraco.Plain.String"
}
}
]
}
import { LitElement, html, css, customElement, property } from '@umbraco-cms/backoffice/external/lit';
import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api';
import { UmbChangeEvent } from '@umbraco-cms/backoffice/event';
import type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/property-editor';
@customElement('my-editor-ui')
export default class MyEditorElement extends UmbElementMixin(LitElement) implements UmbPropertyEditorUiElement {
@property({ type: String })
public value = '';
#onChange(e: Event) {
const input = e.target as HTMLInputElement;
this.value = input.value;
this.dispatchEvent(new UmbChangeEvent());
}
render() {
return html`
<uui-input
.value=${this.value || ''}
@change=${this.#onChange}
></uui-input>
`;
}
static styles = css`
:host {
display: block;
}
`;
}
declare global {
interface HTMLElementTagNameMap {
'my-editor-ui': MyEditorElement;
}
}
import type { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor';
@customElement('my-editor-ui')
export default class MyEditorElement extends UmbElementMixin(LitElement) implements UmbPropertyEditorUiElement {
@property({ type: String })
public value = '';
@state()
private _maxChars?: number;
@state()
private _placeholder?: string;
@property({ attribute: false })
public set config(config: UmbPropertyEditorConfigCollection) {
this._maxChars = config.getValueByAlias('maxChars');
this._placeholder = config.getValueByAlias('placeholder');
}
render() {
return html`
<uui-input
.value=${this.value || ''}
.placeholder=${this._placeholder || ''}
.maxlength=${this._maxChars}
@change=${this.#onChange}
></uui-input>
`;
}
}
{
"type": "propertyEditorUi",
"alias": "My.PropertyEditorUi.Custom",
"name": "My Custom Editor",
"element": "/App_Plugins/MyEditor/editor.js",
"elementName": "my-editor-ui",
"meta": {
"label": "My Custom Editor",
"propertyEditorSchemaAlias": "Umbraco.Plain.String",
"settings": {
"properties": [
{
"alias": "maxChars",
"label": "Maximum Characters",
"propertyEditorUiAlias": "Umb.PropertyEditorUi.Integer"
},
{
"alias": "placeholder",
"label": "Placeholder Text",
"propertyEditorUiAlias": "Umb.PropertyEditorUi.TextBox"
}
],
"defaultData": [
{ "alias": "maxChars", "value": 100 }
]
}
}
}
清单中的 propertyEditorSchemaAlias 必须引用一个在服务器上存在的 schema:
| 部分 | 位置 | 语言 |
|---|---|---|
| 属性编辑器 UI | 客户端 | TypeScript |
| 属性编辑器 Schema | 服务器 | C# |
DataEditor 类 - 仅在需要自定义验证/转换时才需要这些内置 schemas 始终可用:
| Schema 别名 | 存储类型 | 使用场景 |
|---|---|---|
Umbraco.Plain.String | string | 简单文本值 |
Umbraco.Integer | int | 数字、评分、计数 |
Umbraco.Decimal | decimal | 价格、百分比 |
Umbraco.Plain.Json | object | 复杂的 JSON 数据 |
Umbraco.DateTime | DateTime | 日期和时间 |
Umbraco.TrueFalse | bool | 切换、复选框 |
Umbraco.TextBox | string | 带验证的文本框 |
Umbraco.TextArea | string | 多行文本 |
常见问题请参见 TROUBLESHOOTING.md,包括:
Umbraco.Plain.Json 时值未持久化UUI 组件(组合框、输入框等)问题请参见 UUI-GOTCHAS.md。
就是这样!请始终获取最新文档,保持示例简洁,生成完整可运行的代码。
每周安装量
78
代码仓库
GitHub 星标数
17
首次出现
2026年2月4日
安全审计
安装于
github-copilot56
cursor26
opencode25
codex25
gemini-cli22
amp22
A Property Editor UI is the visual component that users interact with in the Umbraco backoffice to input and manage content data. It's one half of a property editor - the UI (client-side TypeScript) pairs with a Schema (server-side C#) that defines data storage.
Always fetch the latest docs before implementing:
The Umbraco source includes a working example:
Location : /Umbraco-CMS/src/Umbraco.Web.UI.Client/examples/property-editor/
This example demonstrates a complete property editor UI implementation with configuration. Study this for production patterns.
Umbraco Element : When implementing the UI element with UmbElementMixin
umbraco-umbraco-elementState Management : When implementing reactive value updates
umbraco-state-managementLocalization : When adding multi-language support to labels
umbraco-localizationWARNING: The
propertyEditorSchemaAliasbelow usesUmbraco.Plain.String, a built-in schema. If you use a custom alias likeMyPackage.CustomSchema, you MUST have a corresponding C#DataEditoron the server or you'll get a 404 error when creating a Data Type.
{
"name": "My Property Editor",
"extensions": [
{
"type": "propertyEditorUi",
"alias": "My.PropertyEditorUi.Custom",
"name": "My Custom Editor",
"element": "/App_Plugins/MyEditor/editor.js",
"elementName": "my-editor-ui",
"meta": {
"label": "My Custom Editor",
"icon": "icon-edit",
"group": "common",
"propertyEditorSchemaAlias": "Umbraco.Plain.String"
}
}
]
}
import { LitElement, html, css, customElement, property } from '@umbraco-cms/backoffice/external/lit';
import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api';
import { UmbChangeEvent } from '@umbraco-cms/backoffice/event';
import type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/property-editor';
@customElement('my-editor-ui')
export default class MyEditorElement extends UmbElementMixin(LitElement) implements UmbPropertyEditorUiElement {
@property({ type: String })
public value = '';
#onChange(e: Event) {
const input = e.target as HTMLInputElement;
this.value = input.value;
this.dispatchEvent(new UmbChangeEvent());
}
render() {
return html`
<uui-input
.value=${this.value || ''}
@change=${this.#onChange}
></uui-input>
`;
}
static styles = css`
:host {
display: block;
}
`;
}
declare global {
interface HTMLElementTagNameMap {
'my-editor-ui': MyEditorElement;
}
}
import type { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor';
@customElement('my-editor-ui')
export default class MyEditorElement extends UmbElementMixin(LitElement) implements UmbPropertyEditorUiElement {
@property({ type: String })
public value = '';
@state()
private _maxChars?: number;
@state()
private _placeholder?: string;
@property({ attribute: false })
public set config(config: UmbPropertyEditorConfigCollection) {
this._maxChars = config.getValueByAlias('maxChars');
this._placeholder = config.getValueByAlias('placeholder');
}
render() {
return html`
<uui-input
.value=${this.value || ''}
.placeholder=${this._placeholder || ''}
.maxlength=${this._maxChars}
@change=${this.#onChange}
></uui-input>
`;
}
}
{
"type": "propertyEditorUi",
"alias": "My.PropertyEditorUi.Custom",
"name": "My Custom Editor",
"element": "/App_Plugins/MyEditor/editor.js",
"elementName": "my-editor-ui",
"meta": {
"label": "My Custom Editor",
"propertyEditorSchemaAlias": "Umbraco.Plain.String",
"settings": {
"properties": [
{
"alias": "maxChars",
"label": "Maximum Characters",
"propertyEditorUiAlias": "Umb.PropertyEditorUi.Integer"
},
{
"alias": "placeholder",
"label": "Placeholder Text",
"propertyEditorUiAlias": "Umb.PropertyEditorUi.TextBox"
}
],
"defaultData": [
{ "alias": "maxChars", "value": 100 }
]
}
}
}
The propertyEditorSchemaAlias in your manifest must reference a schema that exists on the server :
| Part | Location | Language |
|---|---|---|
| Property Editor UI | Client | TypeScript |
| Property Editor Schema | Server | C# |
DataEditor class - only needed for custom validation/conversionThese built-in schemas are always available:
| Schema Alias | Stores | Use Case |
|---|---|---|
Umbraco.Plain.String | string | Simple text values |
Umbraco.Integer | int | Numbers, ratings, counts |
Umbraco.Decimal | decimal | Prices, percentages |
Umbraco.Plain.Json |
See TROUBLESHOOTING.md for common issues including:
Umbraco.Plain.JsonSee UUI-GOTCHAS.md for UUI component issues (combobox, input, etc.).
That's it! Always fetch fresh docs, keep examples minimal, generate complete working code.
Weekly Installs
78
Repository
GitHub Stars
17
First Seen
Feb 4, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykWarn
Installed on
github-copilot56
cursor26
opencode25
codex25
gemini-cli22
amp22
Angular开发者指南:从项目创建到组件与信号式状态管理的最佳实践
598 周安装
object |
| Complex JSON data |
Umbraco.DateTime | DateTime | Dates and times |
Umbraco.TrueFalse | bool | Toggles, checkboxes |
Umbraco.TextBox | string | Textbox with validation |
Umbraco.TextArea | string | Multi-line text |