
前端
mingyuelcx
这个作者很懒,什么都没留下…
展开
-
react跳转路由报错Cannot read property ‘push’ of undefined
问题就出在父子组件上,在父组件调用子组件定义的跳转事件时,要传递history在父组件上写 history={this.props.history}转载自 https://dsx2016.com/?p=470转载 2020-07-21 17:58:25 · 1478 阅读 · 0 评论 -
JS图片上传功能
图片上传到服务器技术栈 : NodeJs + ajax / html两种方式1、表单验证 form用post方式请求 要加 enctype=“multipart/form-data”(文件上传必须要加) <form action="http://localhost:3000/imgup/upload" method="POST" enctype="multipart/form-data"> <input type="file" name="logo">原创 2020-07-06 14:45:59 · 1256 阅读 · 0 评论 -
nodeJS静态资源
设置静态资源防止跨域const express = require("express");const path = require("path");const app = express();app.use(express.static(path.resolve(__dirname,"../xxx")));app.listen(80,function(){ console.log("success");})原创 2020-06-30 19:32:45 · 449 阅读 · 0 评论 -
vue路由
vue子路由写法一: router目录下的index.js {path:'/Cart',name:"cart",component:Cart,children:[ {path:"/login",name:"login",component:Login}, {path:"/res",naem:"res",component:Res} ]}, 二级路由的父组件 Cart组件 <template> <div> <div> <rout原创 2020-06-22 19:52:11 · 175 阅读 · 0 评论 -
前端,写代码过程中遇到的一些坑
浏览器自动填充密码写了个登录页面,结果就发现输入框中总是自己出现账号密码。这是不合情理的,所以要去掉这种效果。在密码input后面加autocomplete="new-password"就可以解决这个问题了原创 2020-05-30 09:50:47 · 357 阅读 · 0 评论