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

Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
This commit is contained in:
shellingfordly 2024-05-28 20:39:18 +08:00 committed by GitHub
parent b5ecb72864
commit ca61022e69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View File

@ -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>

View File

@ -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,