From 5338367ea3a4fb256ce1e670cb6cdb0599bd2f77 Mon Sep 17 00:00:00 2001 From: Cyrbuzz Date: Thu, 20 Apr 2023 18:42:15 +0800 Subject: [PATCH] fix(Watermark): add xlink namespace and fix blob MIME type (#11762) * fix(watermark): add xlink namespace and fix blob MIME type * test(watermark): test snapshots --- packages/vant/src/watermark/Watermark.tsx | 10 +++++++++- .../watermark/test/__snapshots__/index.spec.ts.snap | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/vant/src/watermark/Watermark.tsx b/packages/vant/src/watermark/Watermark.tsx index f4133e8f5..4a89516cd 100644 --- a/packages/vant/src/watermark/Watermark.tsx +++ b/packages/vant/src/watermark/Watermark.tsx @@ -57,6 +57,10 @@ export default defineComponent({ return ( { + // svg MIME type: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types const svgBlob = new Blob([svgStr], { - type: 'image/svg+xml;charset=utf-8', + type: 'image/svg+xml', }); return URL.createObjectURL(svgBlob); }; diff --git a/packages/vant/src/watermark/test/__snapshots__/index.spec.ts.snap b/packages/vant/src/watermark/test/__snapshots__/index.spec.ts.snap index e0c656263..cd9edea6f 100644 --- a/packages/vant/src/watermark/test/__snapshots__/index.spec.ts.snap +++ b/packages/vant/src/watermark/test/__snapshots__/index.spec.ts.snap @@ -9,6 +9,7 @@ exports[`watermark should render content 1`] = ` width="100" height="100" xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" style="padding: 0px 0px 0px 0px;" >