Token导航 LogoToken导航

Agent Skill · 开发

react-to-axure(React TO axure 开发)

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

react-to-axure 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 14,634。

总安装 679周安装 28GitHub Stars 11下载 222核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:react-to-axure(React TO axure 开发)
来源仓库:https://github.com/lintendo/axhub-skills
仓库路径:skills/react-to-axure
安装命令:
npx skills add https://github.com/lintendo/axhub-skills --skill react-to-axure
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/lintendo/axhub-skills --skill react-to-axure

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

辅助 React 组件向 Axure 原型工具转换开发。适用于生成或审查从 React 到 Axure 的设计交付代码。可整理交互逻辑、状态同步与原型保真度实现。react-to-axure 属于开发类 Skill,可作为该场景下的辅助能力补充。需结合项目设计流程与工具链使用,避免信息丢失。

建议在关键交互路径上配合设计师与开发者协同验证。

来源仓库内路径:skills/react-to-axure

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/lintendo/axhub-skills --skill react-to-axure;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

react-to-axure 怎么安装?

在终端执行 npx skills add https://github.com/lintendo/axhub-skills --skill react-to-axure。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

react-to-axure 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

react-to-axure 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

react-to-axure 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

react-to-axure 用的人多吗?

公开数据是累计安装 679 次,近一周安装 28 次,下载 222 次,GitHub 11 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

react-to-axure 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
react-to-axure

React TO axure 开发 · 本页

67911只读未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

React 导出到 Axure

概述

本技能将帮助你把任意 React 组件或应用改造为可导入 Axure 原型平台的标准组件。改造完成后,组件将具备:

  • 配置面板:在 Axure 编辑器中提供可视化配置项(颜色、文本、数值等)
  • 事件系统:向 Axure 原型发送自定义事件
  • 动作系统:响应来自 Axure 原型的外部调用
  • 变量暴露:将内部状态暴露给 Axure 原型读取
  • 数据接入:接收来自 Axure 原型的外部数据源

本技能产出两类产物:

  1. 配置声明:5 组常量(EVENT_LIST / ACTION_LIST / VAR_LIST / CONFIG_LIST / DATA_LIST)
  2. 运行时封装:使用 forwardRef + useImperativeHandle 包装的组件代码

何时使用

  • 你有一个现成的 React 组件,希望在 Axure 原型中使用
  • 你的 React 应用需要与 Axure 原型系统进行双向交互
  • 你需要为 React 组件生成标准化的配置面板定义

引用文件

本技能附带了完整的类型定义文件,可直接复制到目标项目中使用:

  • references/axure-types.ts:核心接口(AxureProps、AxureHandle)和工具函数
  • references/config-panel-types.ts:配置面板组件的完整类型定义

改造工作流程

第 1 步:分析源组件

分析目标 React 组件的以下方面:

  1. Props 接口:组件当前接收哪些 props?
  2. 内部状态:有哪些 useState / useReducer 状态需要暴露?
  3. 交互行为:有哪些用户交互事件(click、change、submit 等)?
  4. 外部依赖:组件依赖哪些第三方库?
  5. DOM 操作:是否直接操作 DOM(如图表库、地图库)?

输出一份改造清单,列出需要映射的 props → config、state → var、callback → event/action。

第 2 步:复制类型定义

将 references/axure-types.ts 复制到目标项目的公共目录中(如 src/common/axure-types.ts)。如果需要配置面板的详细类型,也复制 references/config-panel-types.ts。

第 3 步:定义接口层

根据分析结果,生成以下 5 组常量定义。

3.1 事件列表 EVENT_LIST

定义组件可以向外触发的事件:

import type { EventItem } from './path-to/axure-types';

const EVENT_LIST: EventItem[] = [
  { name: 'onClick', desc: '点击时触发' },
  { name: 'onChange', desc: '值改变时触发,payload 为新值的 JSON 字符串' }
];

规则:

  • name:事件名称,建议使用 camelCase
  • desc:事件描述,说明触发时机
  • payload:可选,描述 payload 的格式(payload 必须是字符串类型,复杂数据需要 JSON.stringify)
3.2 动作列表 ACTION_LIST

定义组件可以响应的外部调用:

import type { Action } from './path-to/axure-types';

const ACTION_LIST: Action[] = [
  { name: 'reset', desc: '重置组件到初始状态' },
  { name: 'setValue', desc: '设置值,参数格式:JSON 字符串', params: 'JSON string' }
];

规则:

  • params 必须是字符串类型,复杂参数需要 JSON.parse 解析
  • desc 应说明参数格式
3.3 变量列表 VAR_LIST

定义组件暴露的内部状态:

import type { KeyDesc } from './path-to/axure-types';

const VAR_LIST: KeyDesc[] = [
  { name: 'current_value', desc: '当前值' },
  { name: 'is_loading', desc: '是否加载中' }
];

规则:

  • name 必须使用 snake_case(小写字母 + 数字 + 下划线)
  • 只暴露外部需要读取的状态,不要暴露内部实现细节
3.4 配置项列表 CONFIG_LIST

定义配置面板中的可配置项:

import type { ConfigItem } from './path-to/axure-types';

const CONFIG_LIST: ConfigItem[] = [
  {
    type: 'input',
    attributeId: 'title',
    displayName: '标题',
    info: '组件顶部显示的标题文本',
    initialValue: '默认标题'
  },
  {
    type: 'colorPicker',
    attributeId: 'primaryColor',
    displayName: '主色调',
    info: '组件的主题颜色',
    initialValue: '#1890ff'
  },
  {
    type: 'inputNumber',
    attributeId: 'maxCount',
    displayName: '最大数量',
    info: '允许的最大数量',
    initialValue: 10,
    min: 1,
    max: 100
  },
  {
    type: 'switch',
    attributeId: 'showBorder',
    displayName: '显示边框',
    info: '是否显示组件边框',
    initialValue: true
  },
  {
    type: 'select',
    attributeId: 'size',
    displayName: '尺寸',
    info: '组件尺寸',
    initialValue: 'medium',
    options: [
      { label: '小', value: 'small' },
      { label: '中', value: 'medium' },
      { label: '大', value: 'large' }
    ]
  }
];

可用 type(详细定义见 references/config-panel-types.ts):

type用途initialValue 类型
input文本输入string
inputNumber数字输入(支持 min/max/step)number
checkbox勾选框boolean
switch开关boolean
slider滑块(需要 min/max)number
select下拉选择(需要 options)`string \number`
colorPicker颜色选择器string(HEX 格式)
autoComplete自动完成输入string
arrayData数组数据编辑器string[]
table表格数据编辑器any[]
map键值对编辑器Record<string, any>
fontSetting字体设置(颜色/大小/粗细等)对象
lineSetting线条设置对象
group分组容器(包含 children)—
collapse折叠面板容器—

映射策略(原始 Props → ConfigItem):

原始 Props 类型推荐 ConfigItem type
stringinput
numberinputNumber
booleanswitch 或 checkbox
enum / unionselect(将枚举值映射为 options)
颜色字符串colorPicker
string[]arrayData
复杂对象/数组table 或 map
3.5 数据项列表 DATA_LIST

定义组件接收的外部数据结构:

import type { DataDesc } from './path-to/axure-types';

const DATA_LIST: DataDesc[] = [
  {
    name: 'items',
    desc: '列表数据',
    keys: [
      { name: 'id', desc: '唯一标识' },
      { name: 'title', desc: '标题' },
      { name: 'value', desc: '值' }
    ]
  }
];

适用场景:适用于列表、表格等数据驱动型组件。纯展示或配置驱动的组件可以设为空数组 []。

第 4 步:封装组件

将原始组件用 forwardRef + useImperativeHandle 包装:

import React, { forwardRef, useImperativeHandle, useState, useCallback } from 'react';
import type { AxureProps, AxureHandle } from './path-to/axure-types';

const WrappedComponent = forwardRef<AxureHandle, AxureProps>(
  function WrappedComponent(innerProps, ref) {
    // ① 安全解构 props(防御性编程)
    const dataSource = innerProps && innerProps.data ? innerProps.data : {};
    const configSource = innerProps && innerProps.config ? innerProps.config : {};
    const onEventHandler = typeof innerProps.onEvent === 'function'
      ? innerProps.onEvent
      : function () { return undefined; };
    const container = innerProps && innerProps.container ? innerProps.container : null;

    // ② 从 config 读取配置值(使用类型检查,避免 || 运算符)
    const title = typeof configSource.title === 'string' && configSource.title
      ? configSource.title
      : '默认标题';
    const maxCount = typeof configSource.maxCount === 'number'
      ? configSource.maxCount
      : 10;

    // ③ 组件内部状态
    const countState = useState(0);
    const count = countState[0];
    const setCount = countState[1];

    // ④ 事件触发(payload 必须是字符串)
    const emitEvent = useCallback(function (eventName: string, payload?: string) {
      try {
        onEventHandler(eventName, payload);
      } catch (error) {
        console.warn('事件触发失败:', eventName, error);
      }
    }, [onEventHandler]);

    // ⑤ 动作处理(params 必须是字符串)
    const handleAction = useCallback(function (name: string, params?: string) {
      switch (name) {
        case 'reset':
          setCount(0);
          break;
        case 'setValue':
          if (params) {
            try {
              const parsed = JSON.parse(params);
              if (typeof parsed.count === 'number') {
                setCount(parsed.count);
              }
            } catch (e) {
              console.warn('参数解析失败:', e);
            }
          }
          break;
      }
    }, []);

    // ⑥ 暴露 Handle 接口
    useImperativeHandle(ref, function () {
      return {
        getVar: function (name: string) {
          const vars: Record<string, any> = {
            current_value: count,
          };
          return vars[name];
        },
        fireAction: handleAction,
        eventList: EVENT_LIST,
        actionList: ACTION_LIST,
        varList: VAR_LIST,
        configList: CONFIG_LIST,
        dataList: DATA_LIST
      };
    }, [count, handleAction]);

    // ⑦ 渲染原始组件(透传改造后的 props)
    return <OriginalComponent title={title} maxCount={maxCount} />;
  }
);

export default WrappedComponent;

第 5 步:适配构建输出

构建产物必须符合以下要求:

  • 输出格式:IIFE(立即执行函数),全局变量名为 UserComponent
  • 外部化依赖:React 和 ReactDOM 必须外部化,不打包进产物
  • 单文件输出:最终产物为单个 JS 文件 + 可选的 CSS 文件

Vite 构建配置示例:

// vite.config.js
export default {
  build: {
    lib: {
      entry: 'src/index.tsx',
      name: 'UserComponent',
      formats: ['iife'],
      fileName: () => 'index.js'
    },
    rollupOptions: {
      external: ['react', 'react-dom'],
      output: {
        globals: {
          react: 'React',
          'react-dom': 'ReactDOM'
        }
      }
    }
  }
};

第 6 步:验证清单

改造完成后,逐项检查:

  • 组件使用 forwardRef<AxureHandle, AxureProps> 包装
  • useImperativeHandle 正确暴露了所有 5 个列表(eventList, actionList, varList, configList, dataList)
  • export default 导出封装后的组件
  • 所有 event payload 都是 字符串类型
  • 所有 action params 都是 字符串类型
  • VAR_LIST 中的 name 使用 snake_case
  • CONFIG_LIST 中的每个项都有 type、attributeId、displayName、initialValue
  • props 解构使用防御性编程(innerProps && innerProps.xxx),不使用 ES6 解构
  • config 值读取使用类型检查,不使用 || 运算符(避免 0/false 被误判)
  • 构建产物格式为 IIFE,全局变量名为 UserComponent
  • React/ReactDOM 已外部化,不重复打包

改造示例

示例 1:简单展示组件

改造前(原始 React 组件):

function StatusCard({ title, status, color }) {
  return (
    <div style={{ borderLeft: `4px solid ${color}` }}>
      <h3>{title}</h3>
      <span>{status}</span>
    </div>
  );
}

改造后(Axure 兼容组件):

import React, { forwardRef, useImperativeHandle } from 'react';
import type { AxureProps, AxureHandle, EventItem, Action, KeyDesc, ConfigItem, DataDesc } from './path-to/axure-types';

const EVENT_LIST: EventItem[] = [];
const ACTION_LIST: Action[] = [];
const VAR_LIST: KeyDesc[] = [
  { name: 'current_status', desc: '当前状态文本' }
];
const CONFIG_LIST: ConfigItem[] = [
  { type: 'input', attributeId: 'title', displayName: '标题', initialValue: '状态卡片' },
  { type: 'input', attributeId: 'status', displayName: '状态', initialValue: '正常' },
  { type: 'colorPicker', attributeId: 'color', displayName: '状态颜色', initialValue: '#52c41a' }
];
const DATA_LIST: DataDesc[] = [];

const Component = forwardRef<AxureHandle, AxureProps>(function StatusCard(innerProps, ref) {
  const configSource = innerProps && innerProps.config ? innerProps.config : {};
  const title = typeof configSource.title === 'string' && configSource.title ? configSource.title : '状态卡片';
  const status = typeof configSource.status === 'string' && configSource.status ? configSource.status : '正常';
  const color = typeof configSource.color === 'string' && configSource.color ? configSource.color : '#52c41a';

  useImperativeHandle(ref, function () {
    return {
      getVar: function (name: string) { return name === 'current_status' ? status : undefined; },
      fireAction: function () {},
      eventList: EVENT_LIST,
      actionList: ACTION_LIST,
      varList: VAR_LIST,
      configList: CONFIG_LIST,
      dataList: DATA_LIST
    };
  }, [status]);

  return (
    <div style={{ borderLeft: '4px solid ' + color, padding: '12px' }}>
      <h3>{title}</h3>
      <span>{status}</span>
    </div>
  );
});

export default Component;

示例 2:交互型组件(带事件和动作)

改造前:

function Counter({ initial = 0, onCountChange }) {
  const [count, setCount] = useState(initial);
  return (
    <div>
      <span>{count}</span>
      <button onClick={() => { setCount(c => c + 1); onCountChange?.(count + 1); }}>+1</button>
      <button onClick={() => setCount(0)}>重置</button>
    </div>
  );
}

改造后:

import React, { forwardRef, useImperativeHandle, useState, useCallback } from 'react';
import type { AxureProps, AxureHandle, EventItem, Action, KeyDesc, ConfigItem, DataDesc } from './path-to/axure-types';

const EVENT_LIST: EventItem[] = [{ name: 'onCountChange', desc: '计数改变时触发' }];
const ACTION_LIST: Action[] = [
  { name: 'increment', desc: '计数 +1' },
  { name: 'reset', desc: '重置计数' },
  { name: 'setCount', desc: '设置计数值,参数:数字字符串', params: 'number string' }
];
const VAR_LIST: KeyDesc[] = [{ name: 'count', desc: '当前计数值' }];
const CONFIG_LIST: ConfigItem[] = [
  { type: 'inputNumber', attributeId: 'initial', displayName: '初始值', initialValue: 0, min: 0 }
];
const DATA_LIST: DataDesc[] = [];

const Component = forwardRef<AxureHandle, AxureProps>(function Counter(innerProps, ref) {
  const configSource = innerProps && innerProps.config ? innerProps.config : {};
  const onEventHandler = typeof innerProps.onEvent === 'function'
    ? innerProps.onEvent : function () {};
  const initial = typeof configSource.initial === 'number' ? configSource.initial : 0;

  const countState = useState(initial);
  const count = countState[0];
  const setCount = countState[1];

  const emitEvent = useCallback(function (eventName: string, payload?: string) {
    try { onEventHandler(eventName, payload); } catch (e) { console.warn(e); }
  }, [onEventHandler]);

  const increment = useCallback(function () {
    setCount(function (prev) {
      var next = prev + 1;
      emitEvent('onCountChange', String(next));
      return next;
    });
  }, [emitEvent]);

  const reset = useCallback(function () {
    setCount(initial);
    emitEvent('onCountChange', String(initial));
  }, [initial, emitEvent]);

  const handleAction = useCallback(function (name: string, params?: string) {
    switch (name) {
      case 'increment': increment(); break;
      case 'reset': reset(); break;
      case 'setCount':
        if (params) {
          var n = parseInt(params, 10);
          if (!isNaN(n)) { setCount(n); emitEvent('onCountChange', String(n)); }
        }
        break;
    }
  }, [increment, reset, emitEvent]);

  useImperativeHandle(ref, function () {
    return {
      getVar: function (name: string) { return name === 'count' ? count : undefined; },
      fireAction: handleAction,
      eventList: EVENT_LIST,
      actionList: ACTION_LIST,
      varList: VAR_LIST,
      configList: CONFIG_LIST,
      dataList: DATA_LIST
    };
  }, [count, handleAction]);

  return (
    <div>
      <span>{count}</span>
      <button onClick={increment}>+1</button>
      <button onClick={reset}>重置</button>
    </div>
  );
});

export default Component;

示例 3:数据驱动型组件

改造前:

function UserList({ users, onSelect }) {
  return (
    <ul>
      {users.map(u => (
        <li key={u.id} onClick={() => onSelect(u)}>
          {u.name} - {u.email}
        </li>
      ))}
    </ul>
  );
}

改造后:

import React, { forwardRef, useImperativeHandle, useState, useCallback } from 'react';
import type { AxureProps, AxureHandle, EventItem, Action, KeyDesc, ConfigItem, DataDesc } from './path-to/axure-types';

const EVENT_LIST: EventItem[] = [{ name: 'onSelect', desc: '选中用户时触发,payload 为用户 JSON' }];
const ACTION_LIST: Action[] = [{ name: 'clearSelection', desc: '清除选中' }];
const VAR_LIST: KeyDesc[] = [{ name: 'selected_user_id', desc: '当前选中的用户 ID' }];
const CONFIG_LIST: ConfigItem[] = [
  { type: 'input', attributeId: 'emptyText', displayName: '空状态文本', initialValue: '暂无数据' }
];
const DATA_LIST: DataDesc[] = [
  {
    name: 'users',
    desc: '用户列表数据',
    keys: [
      { name: 'id', desc: '用户 ID' },
      { name: 'name', desc: '用户姓名' },
      { name: 'email', desc: '用户邮箱' }
    ]
  }
];

const Component = forwardRef<AxureHandle, AxureProps>(function UserList(innerProps, ref) {
  const dataSource = innerProps && innerProps.data ? innerProps.data : {};
  const configSource = innerProps && innerProps.config ? innerProps.config : {};
  const onEventHandler = typeof innerProps.onEvent === 'function'
    ? innerProps.onEvent : function () {};
  const emptyText = typeof configSource.emptyText === 'string' && configSource.emptyText
    ? configSource.emptyText : '暂无数据';
  var users = Array.isArray(dataSource.users) ? dataSource.users : [];

  const selectedState = useState<string | null>(null);
  const selectedId = selectedState[0];
  const setSelectedId = selectedState[1];

  const emitEvent = useCallback(function (eventName: string, payload?: string) {
    try { onEventHandler(eventName, payload); } catch (e) { console.warn(e); }
  }, [onEventHandler]);

  const handleAction = useCallback(function (name: string) {
    if (name === 'clearSelection') setSelectedId(null);
  }, []);

  useImperativeHandle(ref, function () {
    return {
      getVar: function (name: string) { return name === 'selected_user_id' ? selectedId : undefined; },
      fireAction: handleAction,
      eventList: EVENT_LIST,
      actionList: ACTION_LIST,
      varList: VAR_LIST,
      configList: CONFIG_LIST,
      dataList: DATA_LIST
    };
  }, [selectedId, handleAction]);

  if (users.length === 0) return <div>{emptyText}</div>;

  return (
    <ul>
      {users.map(function (u: any) {
        return (
          <li key={u.id} onClick={function () {
            setSelectedId(u.id);
            emitEvent('onSelect', JSON.stringify(u));
          }}>
            {u.name} - {u.email}
          </li>
        );
      })}
    </ul>
  );
});

export default Component;

常见问题

Q: 组件使用了图表库(ECharts、D3)等直接操作 DOM 的库怎么办?

使用 innerProps.container 获取 DOM 容器,在 useEffect 中初始化图表引擎:

const container = innerProps && innerProps.container ? innerProps.container : null;

useEffect(function () {
  if (!container) return;
  const chart = echarts.init(container);
  chart.setOption({ /* ... */ });
  return function () { chart.dispose(); };
}, [container]);

return null; // 直接使用 container 渲染时返回 null

Q: 组件的 props 很复杂(嵌套对象),如何映射到 CONFIG_LIST?

  • 扁平化:将嵌套属性用 attributeId 的点分隔路径表示,如 'style.fontSize'
  • 分组:使用 type: 'group' 或 type: 'collapse' 组织相关配置项
  • 复杂结构:使用 table 或 map 类型编辑器

Q: 原始组件用了 props 解构、箭头函数,需要改写吗?

建议改写以提升兼容性:

  • 使用 function 关键字替代箭头函数
  • 使用 innerProps && innerProps.xxx 替代解构(防御性编程)
  • 使用 useState 返回值的数组索引访问而非解构

Q: 如何处理组件的样式?

  • 将 CSS 放在同目录的 style.css 中并 import './style.css'
  • 使用带组件前缀的类名避免全局冲突(如 my-chart-container)
  • 避免全局样式污染

类型参考

完整的类型定义见本技能的 references/ 目录:

  • references/axure-types.ts:核心接口和工具函数

- AxureProps:组件 Props 接口(data、config、onEvent、container) - AxureHandle:组件 Handle 接口(getVar、fireAction、5 个列表) - EventItem:事件定义 {name, desc, payload?} - Action:动作定义 {name, desc, params?} - KeyDesc:变量/数据字段定义 {name, desc}(name 必须 snake_case) - DataDesc:数据源定义 {name, desc, keys: KeyDesc[]} - ConfigItem:配置面板项定义 - safeEmitEvent、createEventEmitter:事件触发工具函数 - getConfigValue、getDataValue:安全取值工具函数

  • references/config-panel-types.ts:配置面板组件详细类型

- InputConfig、InputNumberConfig、CheckboxConfig、SliderConfig - SelectConfig、AutoCompleteConfig、ColorPickerConfig - ArrayDataConfig、TableConfig、MapConfig - FontSettingConfig、LineSettingConfig、PointSettingConfig - GroupConfig:分组布局

平台分布

Codex

35.65%
按下载量换算79

Claude

31.16%
按下载量换算69

Cursor

18.03%
按下载量换算40

Gemini CLI

10.72%
按下载量换算24

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills