随笔分类 -  *vue

前端实现图片验证效果
摘要:效果图: // 页面执行 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>图形验证码</title> </head> <body> <div id="v_container" style="width: 200px;height 阅读全文

posted @ 2023-09-05 11:44 一名小学生呀 阅读(202) 评论(0) 推荐(0)

vue项目全局api接口封装
摘要:项目通常情况下,api封装放在src 下utils 文件下 request.js // 安装 axios cnpm install axios --save // 新建request.js// 通常项目的拦截,封装方法都封装在这里 import axios from 'axios' const in 阅读全文

posted @ 2023-09-05 11:06 一名小学生呀 阅读(145) 评论(0) 推荐(0)

animate.css动画库
摘要:使用CSS3的animation制作的动画效果的CSS集合,里面预设了很多种常用的动画(官网:https://animate.style/) // 安装 npm install animate.css (npm安装) https://unpkg.com/animate.css@3.5.2/anima 阅读全文

posted @ 2023-08-28 09:56 一名小学生呀 阅读(441) 评论(0) 推荐(0)

鼠标任意拖动元素排列顺序(vue)
摘要:参考地址:https://codesandbox.io/s/condescending-butterfly-enjqpr?file=/src/App.vue <template> <div> <transition-group name="drag" class="list" tag="ul"> < 阅读全文

posted @ 2023-08-28 09:40 一名小学生呀 阅读(88) 评论(0) 推荐(0)

异步动态引入组件
摘要:// vue3 写法 <component :is="componentParam[active] " /> // 引入api import { defineAsyncComponent } from 'vue' const active = ref('b') const componentPara 阅读全文

posted @ 2023-08-28 09:20 一名小学生呀 阅读(38) 评论(0) 推荐(0)

vue-颜色选择器(vColorPicker)
摘要:// 安装插件 // 官网:http://vue-color-picker.rxshc.com/ npm install vcolorpicker -S // main.js 中全局引入 import vcolorpicker from 'vcolorpicker' Vue.use(vcolorpi 阅读全文

posted @ 2023-08-28 09:14 一名小学生呀 阅读(215) 评论(0) 推荐(0)

点击实现文字复制
摘要:// 1. 创建一个方法文件 fun.js export const copyToClipboard = (text, callback) => { if (navigator.clipboard) { // clipboard api 复制 navigator.clipboard.writeTex 阅读全文

posted @ 2023-08-23 09:51 一名小学生呀 阅读(38) 评论(0) 推荐(0)

生成随机数
摘要:Math.random()*10 //生成0-10的随机数,包含0,不包含10 Math.ceil(Math.random()*10) //ceil向上取整,即生成1-10的随机整数,取0的概率极小 Math.floor(Math.random()*10) //floor向下取整,即生成0-9的随机 阅读全文

posted @ 2022-10-18 18:10 一名小学生呀 阅读(122) 评论(0) 推荐(0)

日期时间的获取
摘要:使用moment插件 // 需要先 npm i moment // 再import moment from 'moment' // 1.获取当前年 const curYear = new Date().getFullYear() // 2.获取当前周 const curWeek = moment() 阅读全文

posted @ 2021-11-29 15:14 一名小学生呀 阅读(830) 评论(0) 推荐(0)

导航