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

api-setting

v1.0.19

Published

![image](./src/assets/images/api-setting-screenshot.jpg)

Downloads

4

Readme

api-setting

一款API匹配组件。在API集市上,选择需要的API,通过拖拽的方式让页面数据和接口数据匹配。

image

功能一览

> 

安装

npm install api-setting

使用

在main.js中添加以下代码

import apiSetting from 'api-setting'
import 'api-setting/dist/style.css'

const app = createApp(App)

app.use(apiSetting)
app.mount('#app')

在页面中

<ApiSetting
    :onRequestApiList="onRequestApiList"
    :getServiceDetail="getDetail"
    :paramList="paramList"
    :editData="editData"
    @onClose="onClose"
    @onSubmit="onSubmit"
/>

配置项

| 属性 | 说明 | 类型 | 默认值 | | :--------------- | :-------------------------------- | :----- | :----- | | onRequestApiList | 配置首页的api分页表格数据 | object:{tableData: array, total:number, success: boolean} | {tableData: [],total: 0,success: true} | | getServiceDetail | 配置单个api详细信息的数据。要求函数返回格式为{request, response, requestHeader} | function | - | | paramList | 配置数据,详情见下表 | object | - | | editData | 如果已经配置了关联关系,则把onSubmit的值保存起来,赋值到改字段 | object | - | | drawerSize | 详情弹框大小 | string | 100% |

paramList

| 属性 | 说明 | 类型 | 默认值 | | :--------------- | :-------------------------------- | :----- | :----- | | inputData | 页面输入元素 | array | [] | | outputData | 输出元素 | array | [] |

interface InputData {
  id: string;
  label?: string;
  dataIndex?: string; // 选填,组件提前配置好的对应接口字段名
  type?: 'string' | 'number' | 'object' | 'array' | 'date' | 'boolean'; // 默认为'string'
  children?: InputData[]; // 当type为’object’、’array’时为复杂数据类型,需要提供数据内部结构children
  parent?: String;
  status?: 'normal' | 'update' | 'add';
}
interface OutputData {
  id: string;
  label?: string;
  dataIndex?: string; // 选填,组件提前配置好的对应接口字段名
  type?: 'text' | 'array' | 'object'; // 默认为'text'
  children?: OutputData[]; // 当type为’object’、’array’时为复杂数据类型,需要提供数据内部结构children
  status?: 'normal' | 'update' | 'add';
}

事件

| 事件名 | 说明 | 参数 | | :--------------- | :-------------------------------- | :----- | | onClose | 弹框关闭时触发 | - | | onSubmit | 点击提交时触发 | ({serviceId, request, requestHeader, response, responseCode, rawSubmitData}) |