Skip to content

Commit 565ebad

Browse files
committed
fix(flexible): 更新版本号为0.1.6.alpha,修改FlexibleOptions接口以简化vw值计算
1 parent 1008e47 commit 565ebad

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

packages/flexible/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cherrywind/flexible",
3-
"version": "0.1.6",
3+
"version": "0.1.6.alpha",
44
"private": false,
55
"keywords": [
66
"flexible"

packages/flexible/src/index.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,9 @@ export interface FlexibleOptions {
6666
*/
6767
matchedIndex: number;
6868
/**
69-
* 原始计算得到的 vw 值(未经过任何比例调整)
69+
* 转换前计算得到的 vw 值。
7070
*/
7171
originalVw: number;
72-
/**
73-
* 计算得到的比例因子。
74-
*/
75-
computedRatio: number;
7672
}) => number;
7773

7874
/**
@@ -198,7 +194,6 @@ export const flexible = (options: FlexibleOptions = {}): (() => void) => {
198194
vw = options.onTransform({
199195
matchedIndex,
200196
originalVw,
201-
computedRatio: ratio?.[matchedIndex] ?? 1,
202197
});
203198
}
204199
if (scope) {
@@ -211,8 +206,7 @@ export const flexible = (options: FlexibleOptions = {}): (() => void) => {
211206
scopeVw = options.onTransform({
212207
scope: item,
213208
matchedIndex,
214-
originalVw,
215-
computedRatio,
209+
originalVw: scopeVw,
216210
});
217211
}
218212
element.style.setProperty(cssVarName, scopeVw + 'px');

0 commit comments

Comments
 (0)