瀏覽代碼

chore: default code for sfc playground

Evan You 5 年之前
父節點
當前提交
2e3984fd5b
共有 1 個文件被更改,包括 17 次插入1 次删除
  1. 17 1
      packages/sfc-playground/src/store.ts

+ 17 - 1
packages/sfc-playground/src/store.ts

@@ -9,7 +9,23 @@ import {
 } from '@vue/compiler-sfc'
 
 const storeKey = 'sfc-code'
-const saved = localStorage.getItem(storeKey) || ''
+const saved =
+  localStorage.getItem(storeKey) ||
+  `
+<template>
+  <h1>{{ msg }}</h1>
+</template>
+
+<script setup>
+const msg = 'Hello World!'
+</script>
+
+<style scoped>
+h1 {
+  color: #42b983;
+}
+</style>
+`.trim()
 
 // @ts-ignore
 export const sandboxVueURL = import.meta.env.PROD