Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

enn-info-panel

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enn-info-panel

信息面板组件

  • 0.0.7
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

InfoPanel

信息面板组件

示例

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

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

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

API

InfoPanel Attributes

参数类型必填默认值说明
schemaObject-数据信息的 schema
dataObject-展示的数据
scenarioStringinfoPanel环境变量
configObject-联动内使用的数据
hasBorderBooleantrue控制是否显示边框
Tips
  • schema 可使用 schema-form-editor 生成,格式参照 schema-form-render 所需 schema 的格式
  • schema 中只有 activated、visible 可以控制当前项是否展示,联动中的代码只有 set 生效
  • 不支持嵌套 子表单、容器等
  • 下拉菜单等数据需要自行处理

示例

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

<script>
import InfoPanel from 'enn-info-panel';
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.less

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

<SchemaFormRender class="enn-form-info-panel" />

BooleanResult

Boolean 状态显示组件

示例

<template>
  <div>
    <BooleanResult :value="value"/>
  </div>
</template>

<script>
import { BooleanResult } from 'enn-info-panel';

export default {
  components: {
    BooleanResult,
  },
  data() {
    return {
      value: true,
    };
  },
}
</script>

API

BooleanResult Attributes

参数类型必填默认值说明
valueBoolean-渲染的值
configObject渲染的配置项
minIconBoolean是否使用点的图标
config Attributes
参数类型必填默认值说明
activeTextString成功true 状态的文案
inactiveTextString失败false 状态的文案
activeIconStringel-icon-succestrue 状态的图标 class
inactiveIconStringel-icon-errorfalse 状态的图标 class

Keywords

FAQs

Package last updated on 30 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc