UNPKG

vivo-ui

Version:

vivo ui component lib for vue

45 lines (44 loc) 963 B
<!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> .vui-cutover > * { height: 200px; background: #fff; } .vui-cutover section { background: gray; } </style> </head> <body> <div id="content"> <button @click="show=!show">切换</button> <cutover type="cover"> <template slot-scope="slot"> <div v-if="show" :style="slot.styleObj"> Now you see me </div> <section v-else :style="slot.styleObj"> Now you don't </section> </template> </cutover> </div> <script> var vm = new Vue({ el: '#content', data: { show: true }, components: { Cutover: VUI.Cutover } }); </script> </body> </html>