<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>多元素过渡</title>
    <style type="text/css">
        .fade-enter,.fade-leave-to{
            opacity: 0;
        }
        .fade-enter-active,.fade-leave-active{
            transition: opacity .5s;
        }
    </style>
</head>
<body>
    <div id="app">
        <button @click="show = !show">切换</button>
        <transition name="fade">
<!--            具有相同标签名元素的切换,需要通过key特性设置唯一的值来标记-->
            <p v-if="show" key="trueMatch">我是火柴</p>
            <p v-else key="falseMath">不是火柴</p>
        </transition>
    </div>

    <script src="../js/vue.js"></script>

    <script>
        let vm = new Vue({
            el:'#app',
            data:{
               show:true,
            }
        });
    </script>
</body>
</html>