tab切换表单填写,提交前的验证,demo只是简单示例,可以按需展开。
阻止了表单的默认事件后即使验证通过也无法提交,需要用Vue或JQ的方法手动让其提交。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Vue form</title>
<script src="../js/vue.min.js"></script>
<style type="text/css">
li {list-style: none}
.nav li {float: left;border: 1px solid purple; height: 30px;width: 100px; text-align: center; vertical-align: middle;line-height: 30px;}
.clear {clear: both;}
.active {background: pink}
</style>
</head>
<body>
<div id="app">
<form action="#