You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

owl-properties

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

owl-properties

properties kanban uesd in odoo owl2

2.2.0
latest
Source
npmnpm
Version published
Weekly downloads
8
-88.73%
Maintainers
1
Weekly downloads
 
Created
Source

owl-properties

基于Odoo OWL 2的属性面板组件库

简介

owl-properties 是一个基于 Odoo OWL 2 框架设计的属性面板组件库,提供简洁易用的标签页切换功能,适用于需要分类展示属性或内容的场景。

安装

# 使用npm
npm install owl-properties

# 使用yarn
yarn add owl-properties

组件

PropertiesPanel

属性面板主组件,提供标签页切换和内容显示功能。

属性

属性类型默认值说明
defaultActivestring''默认激活的标签页值
tabsArray<TabProps>[]标签页配置数组
forceRenderbooleanfalse是否强制渲染所有标签页内容
onChangeTabfunction-标签页切换回调函数

TabProps类型说明

属性类型必选说明
labelstring标签页显示的文本
valuestring标签页的唯一标识
componentComponent标签页内容对应的组件
propsObject传递给组件的属性
iconstring标签页图标html片段,需要使用markup包裹

使用示例

import { PropertiesPanel } from 'owl-properties';
import { Component, markup } from '@odoo/owl';

class MyComponent extends Component {
  static components = { PropertiesPanel };

  static template = xml`
    <PropertiesPanel 
      defaultActive="'tab1'" 
      tabs="tabs" 
      onChangeTab.bind="onTabChange"
    />
  `;

  setup() {
    this.tabs = [
      {
        label: '标签1',
        value: 'tab1',
        component: TabContent1,
        props: {
          /* 传递给组件的属性 */
        },
      },
      {
        label: '标签2',
        value: 'tab2',
        component: TabContent2,
        icon: markup('<span>icon</span>'),
      },
    ];

    this.onTabChange = (tabValue) => {
      console.log('当前激活标签:', tabValue);
    };
  }
}

Tab

标签页组件,用于显示和切换标签。

属性

属性类型默认值说明
activestring-当前激活的标签页值
tabsArray<TabProps>-标签页配置数组
onChangefunction-标签页切换回调函数
classNamestring-自定义类名

Empty

空状态组件,当没有内容时显示。

开发

# 安装依赖
yarn install

# 启动开发服务
yarn start

# 构建
yarn build

# 代码检查
yarn eslint

许可证

LGPL-3.0

Keywords

owl

FAQs

Package last updated on 01 Aug 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.