UNPKG

vivo-ui

Version:

vivo ui component lib for vue

45 lines (43 loc) 1.05 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script src="https://cdn.bootcss.com/vue/2.5.16/vue.js"></script> <script src="../../dist/lib.js"></script> <style> .box { background: red; } </style> </head> <body> <div id="content"> <button @click="show=!show">开关</button> <vivo-slide :duration="500" timing-function="linear"> <!--注意:容器只能用v-show来条件渲染--> <div class="box" v-show="show"> <div v-for="number in numbers">{{number}}</div> </div> </vivo-slide> </div> <script> var vm = new Vue({ el: '#content', data: { numbers: (function () { var array = []; for (var i = 0; i < 20; i++) { array.push(i); } return array; }()), show: false }, components: { VivoSlide: VUI.Slide } }); </script> </body> </html>