
vue
阿喻
这个作者很懒,什么都没留下…
展开
-
vue 搭建的前端页面发送Ajax请求到 node+express 服务时的跨域问题, 自定义请求头,携带cookies的解决方法
自己起服务的时候, 前端自定义请求头和携带cookies, 设置CORS一直有问题之前设置跨域的问题失败的原因是: 将下面的这段代码添加到了具体的请求路径 ".newsDetail"当中加上下面这段代码就不会报跨域了,当一个路径有多个匹配规则时,使用app.use,否则使用相应的app.method(get、post)自定义请求头及携带cookies后台的设置:自定义...原创 2018-09-27 18:22:45 · 1442 阅读 · 0 评论 -
为什么vue 中data必须的返回函数
data的定义方式 data的值是一个对象, 是引用数据类型,如果不用函数return ,每个组件的data 都是同一个对象,一个数据改变了其他也改变了;所以为了不让多处的组件共享同一data对象,只能返回函数。更深的理解 https://www.cnblogs.com/libin-1/p/6878057.html...原创 2018-09-27 18:21:09 · 4159 阅读 · 0 评论 -
vue-loader was used without the corresponding plugin.
安装完vue-loader和vue-template-compiler后,npm run dev 报错vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.查了官方文档: https://vue-loader.vuej...原创 2018-09-27 17:56:31 · 905 阅读 · 0 评论 -
Cannot find module '@babel/core'
babel-loader@8 requires Babel 7.x (the package '@babel/core'). If you'd like to use Babel 6.x ('babel-core'), you should install 'babel-loader@7'.这个是由于babel升级了一个大版本,已经到7.X了, 安装了 babel-loader@8 需要 ...原创 2018-09-27 15:38:04 · 5087 阅读 · 0 评论 -
vue 打包放服务器,css样式不显示
vue 打包以后,在本地起服务能够访问,但是当放到服务器的时候,得到下面的提示信息,意思是已经下载到了表单样式,但是表单的MIME type 是流,我们知道表单样式的唯一的MIME类型是text/css,所以的的解决办法是需要在服务器设置表单样式的MIME类型为text/css就可以。在搜集资料的过程发现,另外一种情况也会出现css效果无法呈现,报如下这个提示信息,Resou...原创 2018-09-27 18:23:43 · 6755 阅读 · 0 评论 -
vue + typescript visual studio报错 [ts] 类型“ThisTypedComponentOptionsWithArrayProps | ComponentOptions
由于标题字数的限制无法全部复制过来,全部的错误提示是这样的[ts] 类型“ThisTypedComponentOptionsWithArrayProps<Vue, object, object, object, never> | ComponentOptions<Vu...”上不存在属性“type”。vue(render + JSX) + typescript 开发前端...原创 2018-08-15 10:58:01 · 3758 阅读 · 0 评论