[SIMPLE] Aide pour intégration d'un CodePen
Fermé
LaryssaX
Messages postés
2
Date d'inscription
vendredi 9 novembre 2018
Statut
Membre
Dernière intervention
17 mai 2019
-
17 mai 2019 à 22:44
SioGabx Messages postés 265 Date d'inscription mardi 21 août 2018 Statut Membre Dernière intervention 17 novembre 2022 - 20 mai 2019 à 12:11
SioGabx Messages postés 265 Date d'inscription mardi 21 août 2018 Statut Membre Dernière intervention 17 novembre 2022 - 20 mai 2019 à 12:11
A voir également:
- [SIMPLE] Aide pour intégration d'un CodePen
- Iphone 14 simple - Guide
- Simple ocr - Télécharger - Bureautique
- Simple file locker - Télécharger - Sécurité
- Intégrer une vidéo dans un powerpoint - Guide
- Montage video simple windows - Guide
1 réponse
SioGabx
Messages postés
265
Date d'inscription
mardi 21 août 2018
Statut
Membre
Dernière intervention
17 novembre 2022
100
20 mai 2019 à 12:11
20 mai 2019 à 12:11
Tient, je l'ai fait marcher, tu a juste à le caller dans une div :
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <title>Vue Tinder</title> <style> /* ?????????demo,????,?????????????? */ html,body{ height: 100%; } body { background: #20262E;overflow: hidden; } #app{ overflow-x:hidden; } /* ??script??????,???????,???????? */ [v-cloak] { display: none; } /* ??!?????????,?????!!! */ #app .vue-tinder { position: absolute; z-index: 1; left: 0; right: 0; top: 23px; margin: auto; width: calc(100% - 20px); height: calc(100% - 23px - 18%); min-width: 300px; max-width: 355px; } /* ????3????????,??????????? */ .nope-pointer { right: 10px; } .like-pointer { left: 10px; } .nope-pointer, .like-pointer { position: absolute; z-index: 1; top: 20px; width: 64px; height: 64px; } .super-pointer { position: absolute; z-index: 1; bottom: 80px; left: 0; right: 0; margin: auto; width: 112px; height: 78px; } /* slot????? */ .pic { width: 100%; height: 100%; background-size: cover; } /* ???? */ .btns { position: absolute; left: 0; right: 0; bottom: 0; margin: auto; height: 18%; display: flex; align-items: center; justify-content: center; min-width: 300px; max-width: 355px; } .btns img{ width: 80px; } </style> </head> <body> <div id="app" v-cloak> <tinder ref="tinder" :queue.sync="queue" @submit="submit"> <template slot-scope="{data}"> <div class="pic" :style="`background-image:url(https://picsum.photos/710/1152/?random=${data.key})`"> </div> </template> <img class="like-pointer" slot="like" src="https://johnnydan.oss-cn-beijing.aliyuncs.com/vue-tinder/like-txt.png"> <img class="nope-pointer" slot="nope" src="https://johnnydan.oss-cn-beijing.aliyuncs.com/vue-tinder/nope-txt.png"> <img class="super-pointer" slot="super" src="https://johnnydan.oss-cn-beijing.aliyuncs.com/vue-tinder/super-txt.png"> </tinder> <div class="btns"> <img src="https://johnnydan.oss-cn-beijing.aliyuncs.com/vue-tinder/nope.png" @click="decide('nope')"> <img src="https://johnnydan.oss-cn-beijing.aliyuncs.com/vue-tinder/super-like.png" @click="decide('super')"> <img src="https://johnnydan.oss-cn-beijing.aliyuncs.com/vue-tinder/like.png" @click="decide('like')"> </div> </div> <script src='https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.22/vue.min.js'></script> <script src='http://unpkg.com/vue-tinder'></script> <script> new Vue({ el: "#app", data: { queue: [] }, created () { this.getData() }, methods: { /** * ????demo???? * @method getData */ getData () { const list = [] for (let i = 0; i < 5; i++) { list.push({ key: Math.random() }) } this.queue = this.queue.concat(list) }, /** * ??????????,??????vue-tinder????????,???? * @method submit * @param {String} choice */ decide (choice) { this.$refs.tinder.decide(choice) }, /** * ?????submit?????,??????? * @method submit * @param {Object} choice {type,key} */ submit (choice) { switch (choice) { case 'nope': // ?? break; case 'like': // ?? break; case 'super': // ?? break; } if (this.queue.length < 2) { this.getData() } } } }) </script> </body> </html>