verify.vue 819 B

1234567891011121314151617181920212223242526272829303132333435
  1. <script setup lang="ts">
  2. import { ref } from "vue";
  3. import Vcode from "vue3-puzzle-vcode";
  4. const isShow = ref(true);
  5. function onSuccess() {
  6. console.log("验证成功");
  7. }
  8. function onFail() {
  9. console.log("验证失败");
  10. }
  11. </script>
  12. <template>
  13. <el-card shadow="never">
  14. <template #header>
  15. <div class="font-medium">
  16. 拼图人机验证、右滑拼图验证(
  17. <el-link
  18. href="https://github.com/javaLuo/vue-puzzle-vcode/tree/vue3"
  19. target="_blank"
  20. style="margin: 0 5px 4px 0; font-size: 16px"
  21. >
  22. github地址
  23. </el-link>
  24. </div>
  25. </template>
  26. <div class="bg-[rgba(15,23,42,0.2)] p-6 w-[360px]">
  27. <Vcode :show="isShow" type="inside" @fail="onFail" @success="onSuccess" />
  28. </div>
  29. </el-card>
  30. </template>