
VUE
多写文章能生发
这个作者很懒,什么都没留下…
展开
-
VUE+Springboot前后端分离开发处理跨域问题
前端处理(前端干不过后端使用此方案):修改config目录下的index.js文件: proxyTable: { //匹配代理的url '/api':{ target:'http://127.0.0.1:80', //实际需要请求的接口域名(IP+端口) pathRewrite:{'^/api':'/'}, //表示重写规则 changeOrigin:true //表示是否跨域 .原创 2021-12-17 18:44:37 · 652 阅读 · 0 评论 -
Command vue init requires a global addon to be installed.Please run undefined @vue/cli-init and try
报错如下:报错的提示大概意思是需要安装全局插件解决方案:npm install -g @vue/cli-init然后就可以创建了:原创 2021-12-16 16:45:38 · 802 阅读 · 0 评论 -
This is probably not a problem with npm. There is likely additional logging output above.
报错如下:处理过程分为以下四步:①删除项目 node_modules 文件夹②删除项目 package-lock.json 文件③清除缓存npm cache clean --force④重新安装npm install原创 2021-11-27 22:09:04 · 458 阅读 · 0 评论 -
99% done plugins ERROR Error: The project seems to require yarn but it‘s not installed
vue项目执行npm run dev的时候报如下错误:99% done plugins ERROR Error: The project seems to require yarn but it’s not installed.经查发现从git上拉取下来的代码有一个yarn.lock文件, cli会判断如果项目中存在yarn.lock文件,就使用yarn运行命令,也就是说之前开发的同事用的yarn作为包管理,提交代码的时候将yarn.lock文件提交到了代码仓库。而我一直使用npm管理依赖包,电脑上原创 2021-07-11 20:24:40 · 12424 阅读 · 0 评论 -
A complete log of this run can be found in: C:\Program Files\nodejs\node_cache\_logs\**\**-debug.log
解决方案:①:②:删除node_modules和package-lock.json文件。从新执行 npm install,然后就是漫长的等待。原创 2021-03-23 16:15:30 · 3141 阅读 · 2 评论 -
× Install fail! Error: EBUSY: resource busy or locked, symlink ‘C:\Users\Admin\ Desktop\***\no
报错如下:解决方案:别把VUE项目放在桌面上!别把VUE项目放在桌面上!别把VUE项目放在桌面上!原创 2021-03-23 14:37:36 · 850 阅读 · 0 评论 -
nexus私服npm install报错:HTTP error 502 Bad Gateway(Cannot download ***/repository/node-sass)
使用nexus搭建maven私服使用nexus搭建npm私服内网无法百度的情况下使用nexus搭建maven私服和npm私服,先在外网电脑中将nexus私服搭建好,然后将私服移植到内网中在VUE项目中执行npm install命令时报错如下:报错打印东西听多了,容易眼花漏掉核心错误:> node-sass@4.14.1 install D:\CANON\WorkSpace\invoice-v\node_modules\node-sass> node scripts/install原创 2021-02-02 15:56:28 · 3656 阅读 · 0 评论 -
nexus搭建npm私服 Cannot download “https://github.com/sass/node-sass*******_binding.node“
> node-sass@4.14.1 install D:\CANON\canon\p-invoice\p-invoice\invoice-v\node_modules\node-sass> node scripts/install.jsDownloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/win32-x64-72_binding.nodeCannot download ".原创 2021-01-22 17:28:43 · 1061 阅读 · 0 评论 -
nexus搭建npm私服
向下滚动页面找到如图所示的三种仓库类型:分别创建这三种类型的仓库:①创建npm(hosted)类型仓库,输入仓库名称npm-hosted,然后点击Create repository创建仓库②创建npm(proxy)类型仓库,输入仓库名称npm-taobaoRemote storage(代理地址)输入:https://registry.npm.taobao.org/勾选Auto blocking enabled将Maximum component age修改为-1将Maxim.原创 2021-01-21 16:42:10 · 1829 阅读 · 5 评论 -
VUE+springboot上传附件(不只是上传图片,各种文件都行)到服务器并且可以预览附带上传时的预览确认
定义组件<template> <div> <v-button-search @click="uploadExcel" style="float:right;">上传</v-button-search> <el-dialog title="上传文件" :visible.sync="dialogTableVisible"> <div style="width:100%;height:200px;">原创 2020-09-10 14:02:13 · 2297 阅读 · 3 评论 -
VUE+Springboot从服务器指定路径下载文件(过程中各种坑的处理)
我们使用的是VUE+Springboot前后端分离模式开发,本地调试的时候使用nginx解决跨越问题:1、后台文件下载接口: @RequestMapping(value = "/downFile") public HttpServletResponse downloadFile(HttpServletResponse response) { try { // 要下载的文件的全路径名 String filePath ="D:\\tes原创 2020-09-03 11:32:50 · 5965 阅读 · 0 评论 -
vue+ElementUI打包发布到服务器element-icon.****.woff报404(el-icon-*不显示或者显示□)
现象:浏览器控制台报错详细:第一个报错是:element-icon.******.woff404解决方法:找到build目录下的utils.js文件,在图中所示的位置加入下面这行代码(如果你没有这行代码的话): publicPath:'../../'然后再打包发布一版看看。...原创 2020-07-23 16:02:14 · 1244 阅读 · 0 评论 -
Access-Control-Allow-Origin VUE本地调试跨域问题使用nginx解决
最近在使用VUE做前后端分离的项目,页面代码开发好了,连接后台获取数据的时候发现怎么都调不到后台接口,页面F12的信息如下:如图所示:重点已经圈起来了,找度娘问了一下,这个报错的意思就是跨域,关于什么是跨域大家自行百度吧,这里就不解释了。下面直接说解决方案:我这里使用的是:nginx(官网下载吧)主要进行三方面设置:1、前端设置(我用的是VUE):...原创 2020-06-11 11:30:34 · 2155 阅读 · 0 评论 -
VUE报错:The template root requires exactly one element.
今天在写VUE组件时碰到一个错误:The template root requires exactly one element.如下图:VUE的模板里有且只能有一个根节点,这里我放了两个el-date-picker元素,所以就报了这个错误,搞个div,把他们两个都放到div里就好了。也就是在template标签中只能有一个根元素,所以我们可以弄一个div,把这个组建中需要的所有元素都放进这个div中就不会报这个错了。...原创 2020-06-04 09:40:21 · 3041 阅读 · 0 评论 -
vue项目执行cnpm run dev报错cnpm : 无法加载文件 C:\Users\MEH\AppData\Roaming\npm\cnpm.ps1,因为在此系统上禁止运行脚本
在VSCODE中导入vue项目执行cnpm run dev时报错如下:解决方案:以管理员身份运行Windows PowerShell(要注意不是cmd)1、输入set-ExecutionPolicy RemoteSigned回车2、输入A回车过程如下:然后回到VSCode,调出命令窗口继续执行:执行命令:cnpm run dev问题解决!...原创 2020-02-24 10:23:29 · 434 阅读 · 0 评论 -
VUE报错:npm WARN build `npm build` called with no arguments. Did you mean to `npm run-script build`?
VUE项目在执行完 npm install之后执行 npm build 的时候报错:解决方式:将命令npm build改为npm run build原创 2020-02-24 00:53:47 · 1644 阅读 · 0 评论