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

enn-schema-info-panel-vue3

v0.0.1

Published

enn-schema-info-panel-vue3

Downloads

2

Readme

SchemaInfoPanel

信息面板组件 for Vue3

调试

  • npm run dev

发包

  • lib 为发包后的文件夹

示例

<template>
  <div>
    <InfoPanel :schema="Schema" :data="data" />
  </div>
</template>

<script>
import InfoPanel from 'enn-schema-info-panel-vue3';
import Schema from './info.schema.json';

export default {
  components: {
    InfoPanel,
  },
  data() {
    return {
      Schema,
      data: {},
    };
  },
}
</script>

API

InfoPanel Attributes

| 参数 | 类型 | 必填 | 默认值 | 说明 | | --------- | ------- | ---- | --------- | ---------------------------- | | schema | Object | 是 | - | 数据信息的 schema | | data | Object | 是 | - | 展示的数据 | | scenario | String | 否 | infoPanel | 环境变量 | | config | Object | 否 | - | 配置项,包括联动内使用的数据 | | hasBorder | Boolean | 否 | true | 控制是否显示边框 |

Tips
  • schema 可使用 schema-form-editor 生成,格式参照 schema-form-render 所需 schema 的格式
  • schema 中只有 activated、visible 可以控制当前项是否展示

config

| 参数 | 类型 | 必填 | 默认值 | 说明 | | -------------- | ------- | ---- | ------ | ---------------------------------------- | | emptySymbol | String | | - | 空值字段填充的符号 | | closeAutoLabel | Boolean | | - | 取消无边框 label 默认值 auto,改为 80px; |

示例

插槽 Slots

<template>
  <div>
    <InfoPanel :schema="Schema" :data="data" >
      <template #itemName="{name, value}">
        {{name}}: {{value}}
      </template>
    </InfoPanel>
  </div>
</template>

<script>
import InfoPanel from 'enn-schema-info-panel-vue3';
import Schema from './info.schema.json';

export default {
  components: {
    InfoPanel,
  },
  data() {
    return {
      Schema,
      data: {},
    };
  },
}
</script>

联动 scenario

{
  "type": "input",
  "label": "名称1",
  "name": "key1",
  "effect": "set('activated', scenario !== 'infoPanel');"
}

info.css

可以用来把 schema-form-render 生成的表单转为信息面板样式 注意:需要自行设置表单的只读或禁用

import "enn-schema-info-panel-vue3/lib/info.css";
<SchemaFormRender class="enn-form-info-panel" />