vue2.0 + vux (四)Home页】的更多相关文章

1.综合页(首页) Home.vue <!-- 首页 --> <template> <div> <!-- 顶部 标题栏 --> <app-header></app-header> <!-- 选项卡 --> <tab :line-width="2" v-model="index"> <tab-item :selected="tag === item"…
设置代理,避免出现跨域问题 /*设置代理,避免出现跨域问题*/ proxyTable: { '/api':{ target: 'https://www.oschina.net/action/apiv2/', changeOrigin: true, pathRewrite: { '^/api': '' } } }, api/index.js  接口配置 /** * 引入 异步请求API */ import "whatwg-fetch" const host_addr='http://19…
1.MySettings.vue <!-- 我的设置 --> <template> <div> <img class="img_1" src="../../assets/img/bg_cir.png"> <div class="news-wrap"> <cell title="我的消息" is-link> <img slot="icon&q…
1.安装 jquery 和 whatwg-fetch (优雅的异步请求API) npm install jquery --save npm install whatwg-fetch --save 2.api接口封装 api/index.js /** * 引入 异步请求API */ import "whatwg-fetch" const host_addr='http://192.168.1.110:8081/' /** * 获取资讯列表 */ export let getList =…
1.Footer组件 Footer.vue <!-- 底部 footer --> <template> <div> <tabbar> <!-- 综合 --> <tabbar-item :link="{path:'/'}" selected> <img slot="icon" src="../assets/img/ic_nav_news_normal.png"> &…
1.main.js import Vue from 'vue' import FastClick from 'fastclick' import VueRouter from 'vue-router' import App from './App' // 自定义的路由文件 import router from './router' // 解决300ms延迟问题 FastClick.attach(document.body) Vue.config.productionTip = false /*…
1.快速搭建项目模板 因为项目使用vux,所以推荐使用vux官网的airyland/vux2 模板,vue-cli工具是vue项目的搭建脚手架 默认为 webpack2 模板,如果你需要使用webpack1,请使用 vue init airyland/vux2#webpack1 projectPath npm install vue-cli -g // 如果还没安装 vue init airyland/vux2 projectPath cd projectPath npm install --r…
爱编程爱分享,原创文章,转载请注明出处,谢谢!http://www.cnblogs.com/fozero/p/6185492.html 一.介绍 vue.js 是 目前 最火的前端框架,vue.js 兼具 angular.js 和 react.js 的优点,并剔除它们的缺点 并且提供了很多的周边配套工具 如vue-router .vue-resource .vuex等等   通过他们我们可以很轻松的构建一个大型单页应用 目前Vue版本为Vue2.0  官网地址http://vuejs.org.c…
组件拆分 先把项目搭建时生成的代码给清了吧 现在static目录下引入reset.css 接着在index.html引入,并且设置<meta> 有时候呢,为了让代码符合我们平时的编码习惯,我们可以在ESLint进行设置,如下: 回到入口js文件main.js,为了好看,我们给它加上分号: 不过这是就会报错了: 所以要到eslintrc.js去设置(上面对应可以去官网查看怎么配置),使它接受这样的编码方式. 现在的App.vue如下: 然后我们编写组件来替换那三个区块. 创建header组件 将…
参考:https://segmentfault.com/a/1190000007630677 自己gitHub项目地址:https://github.com/shixiaoyanyan/vue-workList-demo 前言 我们将会选择使用一些vue周边的库vue-cli, vue-router,vue-resource,vuex 1.使用vue-cli创建项目2.使用vue-router实现单页路由3.用vuex管理我们的数据流4.使用vue-resource请求我们的node服务端5.使…