07 2021 档案
摘要:为什么不用锚点 锚点会改变 url 地址,将锚点的值添加到 url 后面 vue 路由的情况下回退需要多次 刷新页面时会找不到页面 滑动特别生硬,没有过度效果 解决 URL 问题 <!-- a标签添加方法,参数为对应锚点的id --> <a @click="clickanchor('#item0')
阅读全文
摘要:需要 移动端调试无法看到控制台 当前环境无法用 npm 方式引入 使用方法 const vConsole = new VConsole(); 源码 /*! * vConsole v3.0.0 (https://github.com/Tencent/vConsole) * * Tencent is p
阅读全文
摘要:原因 IE游览器只识别 yyyy/MM/dd hh:mm:ss 格式 new Date(time.replace(/-/g, '/').slice(0, time.indexOf('.')))
阅读全文
摘要:方法 获取上一个页面的页面实例,在返回之前修改实例数据 let pages = getCurrentPages(); //获取所有页面栈实例列表 let nowPage = pages[ pages.length - 1]; //当前页页面实例 let prevPage = pages[ pages
阅读全文
摘要:将页面配置到路由 let routeData = this.$router.resolve({ name: "detail", query: {goodsId:'1111'} }); window.open(routeData.href, '_blank');
阅读全文
摘要:方法 根据设计图和实际情况下的屏幕宽度做对比,自适应倍数 (function () { function resize() { // 设计稿宽度 const designWidth = 1920; // 屏幕宽度 const windowWidth = window.innerWidth; // h
阅读全文
摘要:react脚手架创建项目 全局安装 npm install -g create-react-app 切换到想创建的目录,使用命令 create-react-app hello-react 进入项目文件夹 cd hello-react 启动项目 npm start react 脚手架项目目录 publ
阅读全文
摘要:需求 当消息超出内容区域时滚动显示 方法 当消息内容超出总内容区域时添加一个与当前消息内容一摸一样的 dom 元素 将总内容区域的 overflow 设置为 hidden,隐藏多余内容 然后控制总内容区域的 scrollTop 来向上轮播 然后当总内容区域的 scrollTop 大于第二个 dom
阅读全文
摘要:需求 创建一个表单组件然后提交 非受控组件 现用现取 class Login extends React.Component { // 表单提交 handleSubmit = () => { const {username, password} = this; alert(`你输入的用户名是:${u
阅读全文
摘要:React 三大组件核心属性之 refs 与事件处理 需求: 两个输入框中间又一个按钮 点击按钮提示左侧输入框数据 右侧输入框失去焦点提示数据 字符串形式的 ref 在元素中添加 ref 属性会添加到组件实例的 refs 中 class MyComponent extends React.Compo
阅读全文
摘要:从vue-element-admin复制文件: vue-admin-template\src\layout\components\TagsView 文件夹 vue-admin-template\src\store\modules\tagsView.js vue-admin-template\src\
阅读全文
摘要:downloadlink(){ let x = new XMLHttpRequest(); x.open("GET", url, true); x.responseType = "blob"; x.onload = function (e) { const url = window.URL.crea
阅读全文