npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

neo-register

v1.1.3

Published

Neo 自定义组件注册器(支持 react 和 vue2.0 技术栈),主要用于注册 Neo 自定义组件和自定义组件模型。

Downloads

213

Readme

neo-register

neo 组件注册器(支持 react 和 vue2.0 技术栈);

  • 提供注册 neo自定义组件 和 neo-editor自定义组件模型 的方法;
  • 目前支持的技术栈:vue2.0、react。

提供的方法

  • registerNeoCmp: 根据 cmpType 注册 neo自定义组件
  • registerNeoEditorModel: 注册 neo-editor 自定义组件模型

快速使用

npm install --save neo-register

注册 neo 自定义组件

import { registerNeoCmp } from 'neo-register';

class MyReactSelect extends React.PureComponent {
  constructor() {
    super();
    this.handleChange = this.handleChange.bind(this);
  }

  handleChange(event) {
    // 调用neo onToggle 方法,变更选择器表单项值
    const {onToggle, options} = this.props;
    const option = options.find(o => o.value === event.target.value);
    if (onToggle) {
      onToggle(option);
    }
  }

  render() {
    // 获取表单项 value 和 options 属性
    const {label, options, title} = this.props;

    return (
      <div className="react-select">
        <span>
          {label}:
        </span>
        <select onChange={this.handleChange} title={title}>
          {options.map(option => (
            <option key={option.value} value={option.value}>
              {option.label}
            </option>
          ))}
        </select>
      </div>
    );
  }
}

// 注册 neo 自定义组件
registerNeoCmp(MyReactSelect, 'react-select');

export default MyReactSelect;

注册 neo-editor 自定义组件模型

import { registerNeoEditorModel } from 'neo-register';

class ReactSelectPlugin {
  cmpType = 'react-select'; // 自定义组件名称,用于标识组件的唯一性
  label = 'select 自定义组件'; // 组件名称,用于设置在编辑器左侧组件面板中展示的名称
  description = 'react-select 自定义组件'; // 组件描述,用于设置在编辑器左侧组件面板中展示的描述
  tags = ['自定义组件']; // 自定义组件分类
  iconUrl = 'https://neo-widgets.bj.bcebos.com/custom-widget.svg'; // 组件图标,用于设置在编辑器左侧组件面板中展示的图标
  defaultComProps = { // 初次插入页面的默认属性数据
    label: 'select 自定义组件',
    name: 'customSelect',
    options: [
      {
        label: 'A',
        value: 'a'
      },
      {
        label: 'B',
        value: 'b'
      },
      {
        label: 'C',
        value: 'c'
      }
    ]
  };
  propsSchema = [ // 组件面板配置,用于生成编辑器右侧属性配置面板内容
    {
      type: 'text',
      name: 'label',
      label: 'label',
      value: 'react-select'
    },
    {
      type: 'textarea',
      name: 'title',
      label: 'hover title',
      value: '点击下拉选择数值'
    }
  ];
}
// 注册一个 neo-editor 自定义组件模型(仅页面设计器需要,会在组件面板中展示)
registerNeoEditorModel(ReactSelectPlugin);

export default ReactSelectPlugin;

自定义组件配置项设置说明