• element-ui vue router 导航菜单刷新高亮

    举例 我的资料 登录记录 js js里添加一个计算函数, computed:{ onRoutes(){ let path = this.$route.path.replace('/',''); return path ? path : '/'; } }

    学习 2019-08-02 5849

  • v-on handler: “TypeError: dateObject.getTime is not a function”

    elementUI时间组件从后台取回数据传入页面报错?? 因为,后台存进去的时候,是按照字符串存的,取回来也是按照字符串回来的,所以穿进去页面会报错,(这个原因我是猜的) 可以这样转换一下,this.data.birth为从后台取回的时间值 this.data.birth = new Date( this.data.birth).getTime() 前端界面显示 后端数据库显示,就是一个字符串

    学习 2019-08-02 4170

  • nuxt script转义

    https://life.blyoo.com/ 本来想加个百度推送代码 但是... 把我的代码给转义了... 高高兴兴的打包上传之后... 报错了这就有点尴尬了... 一看源代码都给转义了... 加上一句这个就可以搞定转义问题了__dangerouslyDisableSanitizers: ['script'] 重新打包上传后,就ok了 在来说一下,如何让代码自定义script加载在底部 上面里面…

    学习 2018-12-16 4040

  • nuxt.js安装

    nuxt.js官网https://zh.nuxtjs.org/ 安装 以下是脚手架模板 vue init nuxt-community/starter-template <project-name> vue init nuxt-community/koa-template <project-name> vue init nuxt-community/express-temp…

    学习 2018-12-13 2474

  • TypeError: Cannot read property ‘eslint’ of undefined

    ERROR in ./.nuxt/client.js Module build failed (from ./node_modules/eslint-loader/index.js): TypeError: Cannot read property 'eslint' of undefined at Object.module.exports (E:\Code\web\web\vue-nuxt-te…

    学习 2018-12-13 8939

  • vue-cli+vue-ssr通过prerender-spa-plugin插件配置

    vue-ssr介绍:vue-ssr介绍 用官方的方法安装配置ssr要死人的,一大堆东西都要手动配置... 但是prerender-spa-plugin不如手动配置好,缺点明显 首先已经安装好vue-cli,在vue-cli脚手架基础上安装的 安装prerender-spa-plugin prerender-spa-plugin:prerender-spa-plugin 然后开始安装prerende…

    学习 2018-11-29 3043

  • Vue路由缓存页面

    Vue切换路由数据缓存, 在index.js路由配置里添加meta meta: { keepAlive: true } 然后再 true:缓存 false:不缓存

    学习 2018-09-19 2516

  • Vue跨域

    网上查找,大部分全都是互相复制的一些,没个卵用的,最后找到了一个详细的 本地反向代理方法,解决跨域问题, 上线的话,在服务器端,也用反向代理, 目前看来,就反向代理这个更简单方便一下吧, 但是再没弄过的情况下,要捣鼓很久,这一系列问题才搞定... 先说,本地反向代理 在本地测试环境下 项目目录下\config\index.js 打开index.js文件 里面找到 这个 proxyTable: {}…

    学习 2018-09-19 2052

  • Vue路由页面刷新404问题

    vue-router使用history模式刷新页面后404问题 由于Vue路由页面都是虚拟的,其实文件并不是真实存在,刷新404,好气哦哦... 经过一番,网上查询后,试了这一个,在服务器Nginx配置文件里,添加如下代码,再刷新就OK了 location / { try_files $uri $uri/ @router; index index.html; } location @router …

    学习 2018-09-19 4102

  • Vue切换路由页面返回顶部

    mmp,网上找了一些,百般测试,一开始试都不行,不知道后面为毛都可以了 第一种 在main.js里添加 // 跳转后返回顶部 router.afterEach((to,from,next) => { window.scrollTo(0,0); }) 第二种 或者下面这个跟上面差不多 router.beforeEach(function(to, from, next) { window.scroll…

    WEB 2018-06-11 4768

  • vue脚手架2.X去掉代码规范检测

    在创建vue脚手架时提示是否启用eslint检测的, Use ESLint to lint your code? 写 no; 如果没仔细看,全部回车进行的话,那就在项目 build目录下/ webpack.base.conf.js文件里面,搜索关键词eslint 把里面这破玩意注释掉, 不然就会一直警告报错。。。 const createLintingRule = () => ({ /*test:…

    WEB 2018-04-07 3707