![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vue
竹杖芒鞋轻胜马,谁怕?一蓑烟雨任平生。
这个作者很懒,什么都没留下…
展开
-
cnpm 报错 Module build failed: Error: No PostCSS Config found in:
现象:执行cnpm run server报错:cnpm 报错 Module build failed: Error: No PostCSS Config found in:原因:缺少配置文件postcss.config.js解决办法:在项目根目录新建配置文件postcss.config.js,贴入如下内容module.exports = { plugins: { 'autoprefixer': {browsers: 'last 5 version'} } }.原创 2020-06-15 00:32:14 · 542 阅读 · 0 评论 -
You may use special comments to disable some warnings. Use // eslint-disable-next-line to ignore the
现象:执行#cnpm run dev报错You may use special comments to disable some warnings.Use // eslint-disable-next-line to ignore the next line.Use /* eslint-disable */ to ignore all warnings in a file. 原因:因为开启了eslint 编码规范检查解决办法:关闭编码规范检查,编辑webpack.base.conf.js原创 2020-06-15 00:03:33 · 780 阅读 · 0 评论 -
解决vue使用element-ui时,报xxx/element-ui/lib/theme-chalk/fonts/element-icons.ttf的问题
执行cnpm run dev报错ERROR in ./node_modules/_element-ui@2.13.2@element-ui/lib/theme-chalk/fonts/element-icons.ttfModule parse failed: Unexpected character '' (1:0)You may need an appropriate loader to handle this file type.(Source code omitted for this bin原创 2020-06-10 02:15:40 · 7035 阅读 · 0 评论 -
vue父子组件传值
父组件给子组件传值1. 父组件调用子组件的时候,绑定动态属性<v-header :title="title"></v-header>2. 在子组件里面通过props接收父组件传过来的数据props:['title]props:{ 'title': String,}3.. 直接在子组件里面使用父组件主动获取子组件的数据和方法:1. 调用子组件的时候定义一个ref方法 <v-header ref="header"></hea原创 2020-05-29 01:27:44 · 170 阅读 · 0 评论 -
Vue vue-reource实现请求数据
使用vue-resource请求数据的步骤:需要安装vue-resource模块,注意加上 --savecnpm install vue-resource --savemain.js 引入vue-resourceimport VueResource from ‘vue-source’;Vue.use(VueResource)在组件里面直接使用 this.$http.get(地址).then(function(){ })使用实例<template> <!--原创 2020-05-24 17:39:07 · 295 阅读 · 0 评论 -
vue.js(三)todo list demo实现
<template> <div id="app"> <input type="text" v-model="todo" @keydown="doAdd($event)"> <button @click="doAdd()">+增加</button> <br> ...原创 2020-05-06 03:03:12 · 276 阅读 · 0 评论 -
Vue双向绑定示例(二)
Vue双向绑定示例<template> <div id="app"> <h2>{{msg}}</h2> <input type="text" v-model="msg"> <button v-on:click="getMsg()"> 获取表单数据get</butt...原创 2020-04-20 01:41:58 · 232 阅读 · 0 评论 -
Vue属性和数据绑定(一)
Vue属性和数据绑定示例<template> <!-- vue的模板里面所有内容要被一个节点包含起来 --> <div> <h2>{{ msg }}</h2> <!-- <br> 这是一个根组件 <h3>{{ obj.name}}</h3> &l...原创 2020-04-20 00:32:52 · 351 阅读 · 0 评论 -
Elements in iteration expect to have 'v-bind:key' directives.'
在学习vue过程中遇到Elements in iteration expect to have ‘v-bind:key’ directives.’ 这个错误,查阅资料得知Vue 2.2.0+的版本里,当在组件中使用v-for时,key是必须设置的。解决方式一:设置对应的key <ol> <li v-for="news in item.list" :ke...原创 2020-04-19 09:58:31 · 526 阅读 · 0 评论 -
{ parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }.
npm run dev报错{ parser: “babylon” } is deprecated; we now treat it as { parser: “babel” }.prettier版本是prettier版本导致的问题。npm i prettier@~1.12.0,之后再重新dev就可以了配置项xx\node_modules\vue-loader\lib\template-...原创 2020-04-19 00:41:25 · 929 阅读 · 0 评论 -
mac vue开发环境搭建
一、vue.js开发环境安装 brew,这个简单,直接执行远程脚本/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"安装 nodejs, brew install nodejs安装淘宝镜像,国内直接使用 npm 的官方镜像是非常慢的,所...原创 2020-04-18 16:49:27 · 595 阅读 · 0 评论