From 9a5bdb15df454fe99b4f695c85a2890d3e059b68 Mon Sep 17 00:00:00 2001 From: Herrington Darkholme <2883231+HerringtonDarkholme@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:12:15 +0800 Subject: [PATCH] chore(playground): support unicode in sfc playground (#3662) atob/btoa only supports ASCII string which makes playground fails to save unicode source. This patch add unicode support by combining escape/encodeURIComponent. `escape` is chosen for backward compatibility. --- packages/sfc-playground/src/store.ts | 5 +++-- packages/sfc-playground/src/utils.ts | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/sfc-playground/src/store.ts b/packages/sfc-playground/src/store.ts index 22080ea10..b68a7042f 100644 --- a/packages/sfc-playground/src/store.ts +++ b/packages/sfc-playground/src/store.ts @@ -1,5 +1,6 @@ import { reactive, watchEffect } from 'vue' import { compileFile, MAIN_FILE } from './sfcCompiler' +import { utoa, atou } from './utils' const welcomeCode = `