Skip to content

Commit e4d6082

Browse files
authored
fix(module:water-mark): nzWaterMark is a block element && standalone (#8197)
fix: #8187
1 parent 165f171 commit e4d6082

6 files changed

Lines changed: 18 additions & 6 deletions

File tree

‎components/water-mark/doc/index.en-US.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,18 @@ Add specific text or patterns to the page.
1414
- Use when the page needs to be watermarked to identify the copyright.
1515
- Suitable for preventing information theft.
1616

17+
module:
1718
```ts
1819
import { NzWaterMarkModule } from 'ng-zorro-antd/water-mark';
1920
```
21+
standalone:
22+
```ts
23+
import { NzWaterMarkComponent } from 'ng-zorro-antd/water-mark';
24+
```
2025

2126
## API
2227

23-
### nz-water-mark
28+
### nz-water-mark:standalone
2429

2530
| Property | Description | Type | Default |
2631
| ----------- | ------------------------------------------------------------------------------------------------- | -------------------- | ------------------------ |

‎components/water-mark/doc/index.zh-CN.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@ cover: https://img.alicdn.com/imgextra/i3/O1CN0194FGAd1FlrwQShfR8_!!600000000052
1515
- 页面需要添加水印标识版权时使用。
1616
- 适用于防止信息盗用。
1717

18+
module:
1819
```ts
1920
import { NzWaterMarkModule } from 'ng-zorro-antd/water-mark';
2021
```
22+
standalone:
23+
```ts
24+
import { NzWaterMarkComponent } from 'ng-zorro-antd/water-mark';
25+
```
2126

2227
## API
2328

24-
### nz-water-mark
29+
### nz-water-mark:standalone
2530

2631
| 参数 | 说明 | 类型 | 默认值 |
2732
| ----------- | ----------------------------------------------------------- | -------------------- | ------------------------ |

‎components/water-mark/style/index.less‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
@water-mark-prefix-cls: ~'@{ant-prefix}-water-mark';
55

66
.@{water-mark-prefix-cls} {
7+
display: block;
78
position: relative;
89
}

‎components/water-mark/typings.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export interface MarkStyleType {
2121
pointerEvents: string;
2222
backgroundRepeat: string;
2323
backgroundPosition?: string;
24+
visibility: string;
2425
}
2526

2627
export interface MarkStyleCanvasType extends MarkStyleType {

‎components/water-mark/water-mark.component.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const FontGap = 3;
3030

3131
@Component({
3232
selector: 'nz-water-mark',
33+
standalone: true,
3334
exportAs: 'NzWaterMark',
3435
changeDetection: ChangeDetectionStrategy.OnPush,
3536
template: ` <ng-content></ng-content> `,
@@ -120,7 +121,8 @@ export class NzWaterMarkComponent implements AfterViewInit, OnInit, OnChanges, O
120121
width: '100%',
121122
height: '100%',
122123
pointerEvents: 'none',
123-
backgroundRepeat: 'repeat'
124+
backgroundRepeat: 'repeat',
125+
visibility: 'visible'
124126
};
125127

126128
/** Calculate the style of the nzOffset */

‎components/water-mark/water-mark.module.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
44
*/
55

6-
import { CommonModule } from '@angular/common';
76
import { NgModule } from '@angular/core';
87

98
import { NzWaterMarkComponent } from './water-mark.component';
109

1110
@NgModule({
1211
exports: [NzWaterMarkComponent],
13-
declarations: [NzWaterMarkComponent],
14-
imports: [CommonModule]
12+
imports: [NzWaterMarkComponent]
1513
})
1614
export class NzWaterMarkModule {}

0 commit comments

Comments
 (0)