- 博客(11)
- 收藏
- 关注
原创 数组合并相同的id
var array = [ { id: 1, count: 1 }, { id: 2, count: 2 }, { id: 1, count: 2 } ]// 要求结果为 // arr = [ // { // id: 1, // count: 3 // }, // { // id: 2, // count: 2 // } // ]解法 funct
2022-05-14 13:48:35
324
原创 轮播图 原生
面试问到轮播图 没答好 回家实现个简单的轮播图<!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /
2022-05-10 09:05:01
90
原创 mysql 数据库 导入及连接
// 1.导入 mysql模块const mysql = require('mysql')// 2.建立与MySQL数据库的连接const db = mysql.createPool({host:'127.0.0.1', // 数据库的ip地址user:'root' , //数据库的账号password:'xxxx', // 登录数据库的密码batabase:' xxxx' //指定要操作哪个数据库})...
2021-08-12 10:57:21
408
原创 input后面::before ::after 无效
今天本来想用input 做个 带倒三角的 当时想用伪类会比较方便 就用input ::after 发现没有效果 <style> .box { margin-left: 10px; height: 50px; width: 200px; box-sizing: border-box; position: relative; } .box::after { transition: all 0.1s;
2021-06-30 16:39:23
1986
原创 简单的vue时间过滤器
Vue.filter("dateFormat", dtStr => { const dt = new Date(dtStr); const y = dt.getFullYear(); const m = dt.getMonth() + 1; const d = dt.getDate(); const hh = dt.getHours(); const mm = dt.getMinutes(); const ss = dt.getSeconds(); return `
2021-06-28 13:29:54
207
原创 vue 3.x路由的创建
import Vue from 'vue' //1. 导入Vue2的构造函数import VueRouter from 'vue-touter' //导入3.x路由的构造函数import Home from '@/components/Home.vue' // 3.导入需要路由切换的组件Vue.use(VueRouter) //4.调用Vue.use() 函数 ,把路由配置为Vue的插件 const router = new VueRouter ({ routes
2021-06-26 20:28:59
162
2
原创 webpack 个插件版本
{ "name": "webpackm", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "build": "webpack -p", "dev": "webpack-dev-server --ope
2021-06-15 16:41:34
156
原创 字符串转换练习
1.把the-first-name" 转换成 TheFirstName// 字符串 截取 var str = 'the-first-name' var arrStr = str.split('-') var arr2 = [] arrStr.forEach(item => { const a = item.charAt(0).toUpperCase() + item.slice(1) arr2.push(a) }) console.log(arr2
2021-06-14 11:33:15
136
原创 怎么判断字符串里面有没有数字!
通过ASCII码判断<script> var str = ' 我是来自杭州,31 今年岁!' // 怎么判断字符串里面有没有数字 for (i = 0; i < str.length; i++) { if (48 <= str.charCodeAt(i) && str.charCodeAt(i) <= 57) { console.log('有数字!') var num = 1 break }..
2021-06-12 13:53:21
473
原创 eslintrc和 vscode个人配置
网上找了很多方法 prittier vuter 自动格式化 vue无效 后来设置了这个 就可以用了vue中js 会自动加逗号在vscode的settings.json中 加个 这个代码 就可以解决
2021-03-17 16:06:51
581
原创 input事件和change事件的区别
input事件–input事件在输入框输入的时候会实时响应并触发change事件change事件在input 失去焦点才会触发vue中用表单修饰符 lazy 可以把 input事件改为change事件
2021-03-02 10:51:24
245
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人