多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
``` <template> <div> <button @click="funClick">显示隐藏</button> <!--第二种操作--> <button @click="isShow = !isShow">Toggle</button> <transition name="fade"> <div v-show="isShow"> <ul> <li>11111</li> <li>22222</li> <li>33333</li> </ul> </div> </transition> </div> </template> ``` ``` <script> export default { data() { return { isShow: false, } }, methods: { funClick() { this.isShow = !this.isShow; }, } } </script> ``` ``` <style scoped> .fade-enter-active, .fade-leave-active { transition: opacity .5s; } .fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ { opacity: 0; } </style> ```