首先把我们需要用到的表单逻辑写入一个js文件
import {
ref, reactive, watch } from "@vue/composition-api"
import axios from "axios"
export default function ({
onError = () => {
} }) {
const industries = ref([])
const form = reactive({
name: ref(""),
telephone: ref(""),
error: ref(""),
nameError: ref(false),
telephoneError: ref(false),
success: ref(false),
failed: ref(false),
})
// funtions for submitting the form
function isValidPhone(telephone) {
const re =