ソースを参照

fix(playground): import type error (#219)

Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
shellingfordly 2 年 前
コミット
ca61022e69
2 ファイル変更5 行追加4 行削除
  1. 4 3
      playground/src/refs.vue
  2. 1 1
      playground/src/todo-mvc.vue

+ 4 - 3
playground/src/refs.vue

@@ -1,9 +1,9 @@
 <script setup lang="ts">
-import { Data } from '@vue/shared'
+import type { Data } from '@vue/runtime-shared'
 import { ref, onMounted } from 'vue/vapor'
 
-const inputRef = ref()
-const buttonRef = ref()
+const inputRef = ref<HTMLInputElement>()
+const buttonRef = ref<HTMLButtonElement>()
 
 function handleSetRef(el: HTMLButtonElement, refs: Data) {
   buttonRef.value = el
@@ -18,6 +18,7 @@ onMounted(() => {
 <template>
   <div>
     <input type="text" ref="inputRef" />
+    <!-- @vue-expect-error TODO fix types -->
     <button :ref="handleSetRef">Button</button>
   </div>
 </template>

+ 1 - 1
playground/src/todo-mvc.vue

@@ -13,7 +13,7 @@ const remaining = computed(() => {
   return tasks.value.filter(task => !task.completed).length
 })
 
-function handleAdd(evt: MouseEvent) {
+function handleAdd(evt: KeyboardEvent | MouseEvent) {
   console.log(evt)
   tasks.value.push({
     title: value.value,