diff --git a/migrate-from-v2.md b/migrate-from-v2.md index 6e386b6808..ee879f5b44 100644 --- a/migrate-from-v2.md +++ b/migrate-from-v2.md @@ -255,12 +255,8 @@ plugins: [ #### Indicator -- 移除 `block`,暴露自定义节点 -- 移除 `align`,暴露自定义节点 -- `vertical` 重命名为`direction`,默认值为 `horizontal`,可选 `vertical` -- 移除 `fillZero`,暴露自定义节点 -- `size` 重命名为 `total` -- 增加非数字展示,并设置为默认状态 +- type 属性的值调整为 `'anchor'` 或 `'slide'` +- color 属性的值增加 `'white'` #### Menu diff --git a/src/config.json b/src/config.json index 57a6efe126..192fd55625 100644 --- a/src/config.json +++ b/src/config.json @@ -1045,6 +1045,7 @@ "sort": 16, "show": true, "taro": true, + "v15": true, "author": "liukun" }, { diff --git a/src/packages/indicator/__test__/__snapshots__/indicator.spec.tsx.snap b/src/packages/indicator/__test__/__snapshots__/indicator.spec.tsx.snap index 6aef6f06d8..d2f9346040 100644 --- a/src/packages/indicator/__test__/__snapshots__/indicator.spec.tsx.snap +++ b/src/packages/indicator/__test__/__snapshots__/indicator.spec.tsx.snap @@ -6,13 +6,13 @@ exports[`should match snapshot 1`] = ` class="nut-indicator" >
diff --git a/src/packages/indicator/__test__/indicator.spec.tsx b/src/packages/indicator/__test__/indicator.spec.tsx index 341aaef23c..b0d76e67e6 100644 --- a/src/packages/indicator/__test__/indicator.spec.tsx +++ b/src/packages/indicator/__test__/indicator.spec.tsx @@ -17,7 +17,9 @@ test('should be shown when passing size and current', () => { ) expect(container.querySelectorAll('.nut-indicator-dot')).toHaveLength(3) - expect(container.querySelectorAll('.nut-indicator-active')).toHaveLength(1) + expect(container.querySelectorAll('.nut-indicator-dot-active')).toHaveLength( + 1 + ) }) test('should be shown when custom node', () => { @@ -41,3 +43,14 @@ test('should be shown when custom node', () => { ) expect(container.querySelectorAll('.nut-indicator-dot')).toHaveLength(5) }) + +test('should be shown when slide', () => { + const { container } = render( +