From 828fa1b51f54f9956f63c1a65e861aac6b300a4c Mon Sep 17 00:00:00 2001 From: Herrington Darkholme <2883231+HerringtonDarkholme@users.noreply.github.com> Date: Sat, 24 Apr 2021 14:30:19 +0800 Subject: [PATCH] feat(playground): support unicode in sfc playground 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 22080ea107e..b68a7042f46 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 = `