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 🙏

© 2024 – Pkg Stats / Ryan Hefner

lby-vue3-amis-custom-widget

v1.0.0

Published

amis自定义组件模板(vue3.0技术栈)

Downloads

4

Readme

vue3-amis-custom-widget

amis 自定义组件模板(vue3.0 技术栈)

目录说明

  • src: 自定义组件源码;
  • src/xxx/plugin.ts: 用于注册一个amis-editor插件,注册成功后编辑器左侧组件面板中会展示;
  • src/xxx/renderer.ts: 用于注册一个amis渲染器,注册成功后编辑器画布区中才会正常展示自定义组件内容;
  • src/xxx/xxx.vue: vue自定义组件源码;
  • src/preview.js: 用于本地预览自定义组件内容;
  • amis.config.js: amis-widget-cli配置文件。

开发说明

  1. 安装依赖
$ npm i 或者 yarn
  1. dev: 本地开发模式(带热更新)

dev开发模式:用于在本地editor中调试自定义组件。

$ npm run dev
  1. preview: 组件预览模式(带热更新)

preview模式:用于预览自定义组件内容。

$ npm run preview
  1. linkDebug: 外链调试(amis-saas中预览自定义组件)

linkDebug模式:用于在amis-saas中预览和调试自定义组件。

$ npm run linkDebug
  1. build2lib: 构建自定义组件输出产物

build2lib模式:用于构建发布到 npm 中的文件,默认存放到 当前dist目录中。

$ npm run build2lib
  1. package.json添加自定义组件信息,导入组件扩展包时需要

package.json 中添加 amis-widgets 字段,用于放置当前自定义组件信息,有这个amis-widgets 字段才能被识别为amis组件扩展包。

  ...
    "amis-widgets": [
    {
      "type": "uni-area-chart",
      "framework": "vue3",
      "description": "折线区域图",
      "entry": "/dist/uniAreaRenderer.umd",
      "files": [
        "/dist/uniAreaRenderer.css"
      ],
      "editorPlugin": {
        "pluginEntry": "/dist/uniAreaPlugin.umd",
        "tag": [
          "图表组件"
        ],
        "sort": 100
      }
    }
    ],
  ...
  1. 发布一个NPM组件扩展包

需要确保package.json中的name值唯一,version值不重复。

$ npm publish
  1. 发布到制定的NPM仓库

打开NPM配置文件(src/.npmrc),配置为制定仓库地址即可。

配置项说明(amis-widget-cli)

请查看amis-widget-cli