2.0.5 • Published 1 year ago

@shihuo/image-ruler-component v2.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

图片标尺

@shihuo/image-ruler-component

图片标尺容器,支持鞋服通用品牌,可充当容器

API

参数名说明必填类型默认值备注
component指定图片外侧容器stringdiv
src图片链接必填string
size容器尺寸number100标尺只支持正方形容器
flex外侧容器 flex 布局booleantrue
ruler显示标尺类型enumnullshoes | clothes | expand | brand 表示鞋类|服饰|通用|品牌标尺。 null 或 undefined 不显示标尺
childRuler显示标尺子类型enum'all'具体枚举值可调用getRulerConfig方法获取注意:childRuler必须是ruler下的子类型时才生效v1.1.9版本新增
hideLine是否手动隐藏标尺booleanfalse当 ruler 有效时生效,hideLine 为 true 时showHideButton 配置失效
showHideButton是否显示右上角隐藏标尺按钮booleantrue当 ruler 有效并且 hideLine 为 false 时生效size>=300 时显示眼睛v2.0.0废弃
hideSpan是否隐藏文字booleanfalse隐藏标尺中的文字标记,仅 ruler=shoes时生效
imageProps传入 src 时,生效imageProps 支持@shihuo/image-component 组件入参v1.1.5 支持
balloon开启大图浮层booleanfalse当传入src时才生效v2.0.0新增
balloonAlign大图浮层显示方位enumr枚举值同Fusion组件库的Balloon组件align属性v2.0.0新增
balloonProps浮层额外配置支持Balloon其他属性配置v2.0.2新增
balloonSrc指定放大浮层的图片string未传入时默认使用srcv2.0.3新增

ImageRulerComponent.Expand

标尺充当容器使用,支持所有上述配置,ruler 默认为 expand。src 属性失效,支持传入 children。

ImageRulerComponent.Clothes

同上。ruler 默认为 clothes

ImageRulerComponent.Shoes

同上。ruler 默认为 shoes

ImageRulerComponent.Brand

同上。ruler 默认为 brand

ImageRulerComponent.Ruler

Ruler组件为标尺组件的核心控件,用于控制线框、浮层文字、中轴虚线和边框虚线 接收 rulerchildRulerhideLinehideSpan。 属性默认值同上。

注意:因线框和浮层文字为绝对定位,所以外层必须设置position: relation;

v1.1.9 版本新增

标尺枚举值及配置项

ImageRuler.config

import ImageRuler from '@shihuo/image-ruler-component';

// 鞋类子类型枚举
// ImageRuler.config.shoesRulerEnum
[
  'adultVertical', // 成人拖鞋俯视图
  'adult', // 成人
  'children', // 小/幼童
  'infant', // 婴童
  'adultSingleHeel', // 成人单只后跟
  'sole', // 鞋底位置
]

// 服饰子类型枚举
// ImageRuler.config.clothesRulerEnum
[
  'central', // 中圈
  'outer', // 外圈
]

// 拓展子类型枚举
// ImageRuler.config.expandRulerEnum
[
  'inner', // 内圈
  'central', // 中圈
  'outer', // 外圈
]

// 品牌子类型枚举
// ImageRuler.config.brandRulerEnum
[
  'fill', // 填充型
  'text', // 文字型
  'routine', // 常规性
]

// 获取对应ruler的枚举值
const config = ImageRuler.getRulerConfig('shoes');

// 获取所有ruler枚举值
const config = ImageRuler.getAllRulerConfig();
2.0.5

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.4

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.1.16

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.19

2 years ago

1.1.17

2 years ago

1.1.21

2 years ago

1.1.20

2 years ago

1.1.9

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.0

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago