随笔分类 -  vue

摘要:搞得我都郁闷了,来记录一下吧 ::v-deep .el-table { color: #ffffff; thead { font-weight: initial; } } ::v-deep .el-table::before { background-color: transparent; } :: 阅读全文
posted @ 2020-10-12 20:31 聂小恶 阅读(487) 评论(0) 推荐(0)
摘要:一、创建web服务器 1通过node创建web服务器 2开启gzip配置 3配置https服务 4使用pm2管理应用 1通过node创建web服务器 创建node项目,并安装express ,通过express快速创建web服务器,将vue打包生成的dist文件夹,托管为静态资源即可,关键代码如下: 阅读全文
posted @ 2020-09-29 17:29 聂小恶 阅读(131) 评论(0) 推荐(0)
摘要:项目优化策略: 1生成打包报告 2第三方库启用CDN 3Element-ui组件按需加载 4路由懒加载 5首页内容定 1——生成打包报告 打包时,为了直观地发现项目中存在的问题,可以在打包时生成报告,生成报告的方式有两种: @1通过命令行参数的形式生成报告 //通过vue-cli 的命令选项可以生成 阅读全文
posted @ 2020-09-27 11:36 聂小恶 阅读(350) 评论(0) 推荐(0)
摘要://全局过滤器 Vue.filter('dateFormat', function(originVal) { const dt = new Date(originVal) const y = dt.getFullYear() const m = (dt.getMonth() + 1 + '').pa 阅读全文
posted @ 2020-09-17 17:30 聂小恶 阅读(321) 评论(0) 推荐(0)
摘要:https://www.bilibili.com/video/BV1bE411p7As?p=29 视频教程 //创建本地user分支,并上传的云端 git branch 查看所有分支 git checkout -b user 新建分支user,并且切换到user分支上 git status 查看本地 阅读全文
posted @ 2020-08-14 11:30 聂小恶 阅读(496) 评论(0) 推荐(0)
摘要:data() { var validatePass = (rule, value, callback) => { if (value '') { callback(new Error('请输入密码')) } else { if (this.form.checkPass !== '') { this. 阅读全文
posted @ 2020-08-13 16:53 聂小恶 阅读(1257) 评论(0) 推荐(0)
摘要:<el-main> <!-- 路由占位符 显示子路由内容 --> <router-view></router-view> </el-main> 路由设置: { path: '/home', component: Home, redirect: '/welcome', //重定向到子路由 childr 阅读全文
posted @ 2020-08-12 10:49 聂小恶 阅读(1983) 评论(0) 推荐(0)
摘要:需求: 需要授权的API,必须在请求头中使用Authorization字段提供token令牌(登录接口不需要) 实现方法:(请求拦截器,预处理设置token) 在发送请求前,设置token,代码如下 阅读全文
posted @ 2020-08-11 17:34 聂小恶 阅读(1169) 评论(0) 推荐(0)
摘要://去除默认的字符串双引号,代码已封号结尾 新建 .prettierrc.json { "singleQuote": true, "semi": false } ok,以上变解决了哈 这里是相关知识 .eslintrc.js rules中设置规则: "off" 或 0 - 关闭这个规则检查 "war 阅读全文
posted @ 2020-08-10 18:26 聂小恶 阅读(133) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2020-08-10 18:18 聂小恶 阅读(9860) 评论(0) 推荐(0)
摘要:import Vue from 'vue' import VueRouter from 'vue-router' import Login from '../components/Login.vue' import Home from '../components/Home.vue' Vue.use 阅读全文
posted @ 2020-08-10 18:07 聂小恶 阅读(947) 评论(0) 推荐(0)
摘要://请求后台配置 import axios from 'axios' axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/' Vue.prototype.$http = axios 发送请求(接口名:login,请求类型:po 阅读全文
posted @ 2020-08-05 10:15 聂小恶 阅读(332) 评论(0) 推荐(0)
摘要:Windows+R cmd vue ui (可视化创建项目) 安装:Babel和Router、Linter/Formatter(源代码格式校验)、使用配置文件 关闭:use history mode for router (推荐使用hash路由) 配置:ESLint+Standard config 阅读全文
posted @ 2020-07-08 17:31 聂小恶 阅读(181) 评论(0) 推荐(0)
摘要:https://www.jianshu.com/p/8bc48f8fde75 电商后台管理系统的技术选型: 1前端项目技术栈 Vue Vue-router Element-UI Axios Echarts 2后端项目技术栈 Node.js Express Jwt MySQL Sequelize 阅读全文
posted @ 2020-07-08 16:56 聂小恶 阅读(222) 评论(0) 推荐(0)
摘要:登录业务流程: 1、在登录页面输入用户名和密码 2、调用后台接口进行验证 3、通过验证之后,根据后台的响应状态跳转到项目主页 技术点: http是无状态的 通过cookie在客户端记录状态 通过session在服务器端记录状态 通过token方式维持状态 (若不存在跨域问题,则推荐使用cookie和 阅读全文
posted @ 2020-06-11 14:43 聂小恶 阅读(216) 评论(0) 推荐(0)
摘要:客户端渲染问题: 请求网站的HTML中是没有内容的。会存在以下问题:无法进行SEO,白屏时间较长要等JS加载执行完成后才显示真正的内容。 React服务端渲染,可以解决以上问题。 https://blog.csdn.net/u012757419/article/details/98974494 「青 阅读全文
posted @ 2020-05-29 15:31 聂小恶 阅读(466) 评论(0) 推荐(0)
摘要:https://www.imooc.com/video/16410学习视频 打包vue或其他第三方包 配置如下: const path = require('path'); const isDev = process.env.NODE_ENV 'development'; const HTMLPlu 阅读全文
posted @ 2020-04-29 16:10 聂小恶 阅读(786) 评论(1) 推荐(1)
摘要:https://www.imooc.com/video/16409 学习视频,老师的版本和目前版本不一致,问题已解决,如下: .vue中的文件是和组件一起异步加载的 1 npm i extract-text-webpack-plugin (注意版本) 2webpack.config.js配置 con 阅读全文
posted @ 2020-04-28 18:14 聂小恶 阅读(1918) 评论(0) 推荐(0)
摘要:<body> <div id="root"> <fade :show='show'> <h1>hello world</h1> </fade> <button @click='handleBtnClick'>tooggle</button> </div> <script> Vue.component 阅读全文
posted @ 2020-02-21 21:34 聂小恶 阅读(194) 评论(0) 推荐(0)
摘要:多个元素过度 多个组件之间的过度动画需要配合动态组件来实现 通过handleClick来改变type,进行组件过度 列表的过度效果:transition-group https://blog.csdn.net/qmz18778391913/article/details/100065724 http 阅读全文
posted @ 2020-02-21 20:27 聂小恶 阅读(519) 评论(0) 推荐(0)