Skip to content

Commit d9950fa

Browse files
WalkAlone0325sendya
authored andcommitted
fix(WaterMark): 修正 props 解构响应式丢失
1 parent 430492d commit d9950fa

File tree

1 file changed

+17
-12
lines changed
  • packages/pro-layout/src/components/WaterMark

1 file changed

+17
-12
lines changed

packages/pro-layout/src/components/WaterMark/index.tsx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,7 @@ const WaterMark = defineComponent({
8686
// antd 内容层 zIndex 基本上在 10 以下 https://github.com/ant-design/ant-design/blob/6192403b2ce517c017f9e58a32d58774921c10cd/components/style/themes/default.less#L335
8787
zIndex = 9,
8888
gapX = 212,
89-
gapY = 222,
9089
width = 120,
91-
height = 64,
92-
rotate = -22, // 默认旋转 -22 度
93-
image,
94-
content,
95-
offsetLeft,
96-
offsetTop,
97-
fontStyle = 'normal',
98-
fontWeight = 'normal',
99-
fontColor = 'rgba(0,0,0,.15)',
100-
fontSize = 16,
101-
fontFamily = 'sans-serif',
10290
prefixCls: customizePrefixCls,
10391
} = props;
10492

@@ -114,6 +102,23 @@ const WaterMark = defineComponent({
114102
const base64Url = ref('');
115103

116104
watchEffect(() => {
105+
const {
106+
gapX = 212,
107+
gapY = 222,
108+
width = 120,
109+
height = 64,
110+
rotate = -22, // 默认旋转 -22 度
111+
image,
112+
content,
113+
offsetLeft,
114+
offsetTop,
115+
fontStyle = 'normal',
116+
fontWeight = 'normal',
117+
fontColor = 'rgba(0,0,0,.15)',
118+
fontSize = 16,
119+
fontFamily = 'sans-serif',
120+
} = props
121+
117122
const canvas = document.createElement('canvas');
118123
const ctx = canvas.getContext('2d');
119124
const ratio = getPixelRatio(ctx);

0 commit comments

Comments
 (0)