因为vue有绑定事件,v-mode,所以只需要给每个input设置value初值,并绑定同一个data,便可以实现单击按钮切换显示不同内容。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>demo8</title>
<link href="https://unpkg.com/animate.css@3.5.1/animate.min.css" rel="stylesheet" type="text/css">
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/velocity/1.2.3/velocity.min.js"></script>
<style>
.component-fade-enter-active,.component-fade-leave-actie{
transition:opacity .
3s ease;
}
.component-fade-enter,.component-fade-leave-actie{
opacity: 0;
}
</style>
</head>
<body>
<div id="app">
<input type="radio" value='v