![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vue2
g-LouHH
这个作者很懒,什么都没留下…
展开
-
vue2环境搭建和项目构建
1.安装node.js 安装后使用npm -v指令查看版本并确定是否安装成功 2.安装cnpm 在命令行中输入 npm install -g cnpm –registry=http://registry.npm.taobao.org 3.使用npm install -g vue-cli命令安装vue-cli脚手架构建工具 4. 在指定的目录下执行命令vue init webpack myVu原创 2018-02-01 10:57:14 · 291 阅读 · 0 评论 -
VUE中使用第三方插件axios记录
第三方插件axios用法: 1.安装 npm install axios 2.在main.js中 引入加载 import Axios form "axios" Vue.prototype.$axios = Axios 延伸:配置axios全局 (1)设置全局请求公共路径:Axios.defaults.baseURL = '公共网址路径'; (2) 设置全局h...原创 2018-10-12 14:09:16 · 248 阅读 · 0 评论 -
VUE跨域解决方案
1.修改config -> index.js文件 proxyTable: { “/api”: { target: “http://localhost:3000”, changeOrigin: true, pathRewrite: { ‘^/api’: ‘’ } } } 2. 在main.js中添加host Vue.prototype.HOST = ‘/api’ 3. 在post 或 get ...原创 2018-10-12 15:33:12 · 547 阅读 · 0 评论 -
vue 父子组件之间传值
父子组件之间传值 1.父 -> 子 props案例: (1)在parent.vue中 <template> <div> 父亲 <Child :title="msg"/> </div> </template> <script> import C原创 2018-10-16 16:13:03 · 209 阅读 · 0 评论 -
vue 中使用路由vue-router
一。路由vue-router 基本加载 1.安装 npm install --save vue-router 2.在main.js中引用 import VueRouter form “vue-router” Vue.use(VueRouter) 3. 在main.js中 new Vue中注入 router 4. 使用 (1).先注入需要路由的组件 import HelloVue form “./c...原创 2018-10-16 16:24:56 · 165 阅读 · 0 评论 -
vue学习记录
以下总结都是在自己学习过程中的记录,便于自己回忆 一。Element组件库 可参考:element官网 1.安装 element-ui cnpm i element-ui -s 2. 采用按需引用 cnpm install babel-plugin-component -D 二。 swiper的使用 可参考地址:https://github.com/surmon-china/vue-awesom...原创 2018-10-16 16:31:46 · 195 阅读 · 0 评论