umbraco-property-action by umbraco/umbraco-cms-backoffice-skills
npx skills add https://github.com/umbraco/umbraco-cms-backoffice-skills --skill umbraco-property-action属性操作是后台办公室中出现在属性标签旁边的按钮,为属性编辑器提供辅助功能。点击时会展开显示可用的操作。属性操作允许您为现有属性编辑器添加辅助功能,而无需修改编辑器本身 - 这对于快捷方式、转换或特定上下文操作非常有用。
在实施前请始终获取最新文档:
上下文 API:当需要访问属性上下文以读取/修改值时
umbraco-context-api模态框:当操作需要打开模态对话框时
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
umbraco-modalsimport type { ManifestPropertyAction } from '@umbraco-cms/backoffice/extension-registry';
const manifest: ManifestPropertyAction = {
type: 'propertyAction',
alias: 'My.PropertyAction.Clear',
name: 'Clear Value',
api: () => import('./clear-action.js'),
forPropertyEditorUis: ['Umb.PropertyEditorUi.TextBox', 'Umb.PropertyEditorUi.TextArea'],
meta: {
icon: 'icon-trash',
label: 'Clear',
},
weight: 100,
};
export const manifests = [manifest];
import { UmbPropertyActionBase } from '@umbraco-cms/backoffice/property-action';
import { UMB_PROPERTY_CONTEXT } from '@umbraco-cms/backoffice/property';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
export class ClearPropertyAction extends UmbPropertyActionBase {
constructor(host: UmbControllerHost, args: any) {
super(host, args);
}
async execute() {
const propertyContext = await this.getContext(UMB_PROPERTY_CONTEXT);
propertyContext?.setValue('');
}
}
export default ClearPropertyAction;
import { UmbPropertyActionBase } from '@umbraco-cms/backoffice/property-action';
import { UMB_PROPERTY_CONTEXT } from '@umbraco-cms/backoffice/property';
export class UppercasePropertyAction extends UmbPropertyActionBase {
async execute() {
const propertyContext = await this.getContext(UMB_PROPERTY_CONTEXT);
const currentValue = propertyContext?.getValue() as string;
if (currentValue) {
propertyContext?.setValue(currentValue.toUpperCase());
}
}
}
export default UppercasePropertyAction;
import { UmbPropertyActionBase } from '@umbraco-cms/backoffice/property-action';
import { UMB_PROPERTY_CONTEXT } from '@umbraco-cms/backoffice/property';
import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal';
export class PickerPropertyAction extends UmbPropertyActionBase {
async execute() {
const propertyContext = await this.getContext(UMB_PROPERTY_CONTEXT);
const modalManager = await this.getContext(UMB_MODAL_MANAGER_CONTEXT);
const modal = modalManager.open(this, MY_PICKER_MODAL, {
data: {
currentValue: propertyContext?.getValue(),
},
});
const result = await modal.onSubmit();
if (result?.value) {
propertyContext?.setValue(result.value);
}
}
}
export default PickerPropertyAction;
const manifest: ManifestPropertyAction = {
type: 'propertyAction',
alias: 'My.PropertyAction.Copy',
name: 'Copy to Clipboard',
api: () => import('./copy-action.js'),
// 省略 forPropertyEditorUis 以针对所有编辑器
meta: {
icon: 'icon-documents',
label: 'Copy',
},
};
Umb.PropertyEditorUi.TextBoxUmb.PropertyEditorUi.TextAreaUmb.PropertyEditorUi.RichTextUmb.PropertyEditorUi.IntegerUmb.PropertyEditorUi.DecimalUmb.PropertyEditorUi.ContentPickerUmb.PropertyEditorUi.MediaPicker就是这样!请始终获取最新文档,保持示例简洁,生成完整可用的代码。
每周安装量
77
仓库
GitHub 星标数
17
首次出现
2026年2月4日
安全审计
安装于
github-copilot55
cursor27
opencode24
codex24
gemini-cli22
amp22
Property Actions are buttons that appear next to property labels in the backoffice, providing secondary functionality for property editors. They expand to show available actions when clicked. Property Actions let you add auxiliary features to existing property editors without modifying the editors themselves - useful for shortcuts, transformations, or context-specific operations.
Always fetch the latest docs before implementing:
Context API : When accessing property context to read/modify values
umbraco-context-apiModals : When the action opens a modal dialog
umbraco-modalsimport type { ManifestPropertyAction } from '@umbraco-cms/backoffice/extension-registry';
const manifest: ManifestPropertyAction = {
type: 'propertyAction',
alias: 'My.PropertyAction.Clear',
name: 'Clear Value',
api: () => import('./clear-action.js'),
forPropertyEditorUis: ['Umb.PropertyEditorUi.TextBox', 'Umb.PropertyEditorUi.TextArea'],
meta: {
icon: 'icon-trash',
label: 'Clear',
},
weight: 100,
};
export const manifests = [manifest];
import { UmbPropertyActionBase } from '@umbraco-cms/backoffice/property-action';
import { UMB_PROPERTY_CONTEXT } from '@umbraco-cms/backoffice/property';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
export class ClearPropertyAction extends UmbPropertyActionBase {
constructor(host: UmbControllerHost, args: any) {
super(host, args);
}
async execute() {
const propertyContext = await this.getContext(UMB_PROPERTY_CONTEXT);
propertyContext?.setValue('');
}
}
export default ClearPropertyAction;
import { UmbPropertyActionBase } from '@umbraco-cms/backoffice/property-action';
import { UMB_PROPERTY_CONTEXT } from '@umbraco-cms/backoffice/property';
export class UppercasePropertyAction extends UmbPropertyActionBase {
async execute() {
const propertyContext = await this.getContext(UMB_PROPERTY_CONTEXT);
const currentValue = propertyContext?.getValue() as string;
if (currentValue) {
propertyContext?.setValue(currentValue.toUpperCase());
}
}
}
export default UppercasePropertyAction;
import { UmbPropertyActionBase } from '@umbraco-cms/backoffice/property-action';
import { UMB_PROPERTY_CONTEXT } from '@umbraco-cms/backoffice/property';
import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal';
export class PickerPropertyAction extends UmbPropertyActionBase {
async execute() {
const propertyContext = await this.getContext(UMB_PROPERTY_CONTEXT);
const modalManager = await this.getContext(UMB_MODAL_MANAGER_CONTEXT);
const modal = modalManager.open(this, MY_PICKER_MODAL, {
data: {
currentValue: propertyContext?.getValue(),
},
});
const result = await modal.onSubmit();
if (result?.value) {
propertyContext?.setValue(result.value);
}
}
}
export default PickerPropertyAction;
const manifest: ManifestPropertyAction = {
type: 'propertyAction',
alias: 'My.PropertyAction.Copy',
name: 'Copy to Clipboard',
api: () => import('./copy-action.js'),
// Omit forPropertyEditorUis to target all editors
meta: {
icon: 'icon-documents',
label: 'Copy',
},
};
Umb.PropertyEditorUi.TextBoxUmb.PropertyEditorUi.TextAreaUmb.PropertyEditorUi.RichTextUmb.PropertyEditorUi.IntegerUmb.PropertyEditorUi.DecimalUmb.PropertyEditorUi.ContentPickerUmb.PropertyEditorUi.MediaPickerThat's it! Always fetch fresh docs, keep examples minimal, generate complete working code.
Weekly Installs
77
Repository
GitHub Stars
17
First Seen
Feb 4, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
github-copilot55
cursor27
opencode24
codex24
gemini-cli22
amp22
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
122,000 周安装