All checks were successful
Build / build-and-test (push) Successful in 29s
[UX] 在路由加载时如果有新的路由请求直接拦截取消 (beforeEach 路由守卫)
21 lines
383 B
Vue
21 lines
383 B
Vue
<script setup>
|
|
import { ref } from 'vue'
|
|
|
|
const emit = defineEmits(['submit'])
|
|
|
|
function handleSubmit(event) {
|
|
event.preventDefault()
|
|
const form = event.target
|
|
const formData = new FormData(form)
|
|
const data = Object.fromEntries(formData.entries())
|
|
emit('submit', data, event)
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<form @submit="handleSubmit">
|
|
<slot></slot>
|
|
</form>
|
|
</template>
|
|
|