fix(playground): 适配 playground 0.04;可设置是否转换为 setup

This commit is contained in:
sight
2022-02-09 11:51:20 +08:00
parent 8a8bc6b0b5
commit b024fc2e3e
2 changed files with 43 additions and 49 deletions

View File

@@ -38,9 +38,9 @@ const toggle = function () {
const onPlayground = function(){
const foundCodes = meta.value.getElementsByClassName('language-html')
const foundCode = foundCodes[0];
const text = foundCode.textContent || "";
const SourceCode = foundCode.textContent || "";
const { link } = usePlayGround(text)
const { link } = usePlayGround(SourceCode, true)
window.open(link)
}