index2.html 808 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Vue 测试实例 - 菜鸟教程(runoob.com)</title>
  6. <script src="https://cdn.bootcss.com/vue/2.2.2/vue.min.js"></script>
  7. <style>
  8. .bounce-enter-active {
  9. animation: bounce-in .5s;
  10. }
  11. .bounce-leave-active {
  12. animation: bounce-in .5s reverse;
  13. }
  14. @keyframes bounce-in {
  15. 0% {
  16. transform: scale(0);
  17. }
  18. 50% {
  19. transform: scale(1.5);
  20. }
  21. 100% {
  22. transform: scale(1);
  23. }
  24. }
  25. </style>
  26. </head>
  27. <body>
  28. <div id = "databinding">
  29. <button v-on:click = "show = !show">点我</button>
  30. <transition name="bounce">
  31. <p v-if="show">菜鸟教程 -- 学的不仅是技术,更是梦想!!!</p>
  32. </transition>
  33. </div>
  34. <script type = "text/javascript">
  35. new Vue({
  36. el: '#databinding',
  37. data: {
  38. show: true
  39. }
  40. })
  41. </script>
  42. </body>
  43. </html>