随笔分类 -  vue

vue2.0
摘要:// 这是目前用的比较多的方式 routes: [ { path: '/', redirect: '/index', component: Index, meta: { keepAlive: true }}, { path: '/common', component: TestParent, children:... 阅读全文
posted @ 2018-01-04 14:29 fm060 阅读(361) 评论(0) 推荐(0)
摘要:1.设置config文件夹index.js中productionSourceMap的值为false,也就是设置webpack配置中devtool为false,打包后文件体积可以减少百分之八十!!!!!!! 2.如何实现打包文件中js、css等的版本控制? 设置build文件夹下的webpack.pr 阅读全文
posted @ 2017-11-15 14:34 fm060 阅读(3611) 评论(0) 推荐(1)
摘要:VueLazyload 阅读全文
posted @ 2017-11-15 11:06 fm060 阅读(99) 评论(0) 推荐(0)
摘要:// 字符串 this.$router.push('/home/first') // 对象 this.$router.push({ path: '/home/first' }) // 命名的路由 this.$router.push({ name: 'home', params: { userId: wise }}) 阅读全文
posted @ 2017-11-13 15:26 fm060 阅读(166) 评论(0) 推荐(0)
摘要:vue axios方法封装 fetch使用 阅读全文
posted @ 2017-10-27 10:38 fm060 阅读(130) 评论(0) 推荐(0)
摘要:一般来讲,获取DOM元素,需document.querySelector(".input1")获取这个dom节点,然后在获取input1的值。 但是用ref绑定之后,我们就不需要在获取dom节点了,直接在上面的input上绑定input1,然后$refs里面调用就行。 然后在javascript里面 阅读全文
posted @ 2017-10-14 01:36 fm060 阅读(1011) 评论(0) 推荐(0)
摘要:verify install npm install vue-verify-plugin use <template> <div class="input-box clearFix"> <div> <input v-model="age" v-verify="age" placeholder="ag 阅读全文
posted @ 2017-10-10 13:53 fm060 阅读(639) 评论(0) 推荐(0)
摘要:待 阅读全文
posted @ 2017-09-30 11:24 fm060 阅读(109) 评论(0) 推荐(0)
摘要:Vue.use(Vuex) const store=new Vuex.Store({ state:{ count:10 }, getters:{ }, mutations:{ INCRENENT(state){ state.count++ } }, actions:{ inputevent({commit}){ commit... 阅读全文
posted @ 2017-09-26 17:08 fm060 阅读(148) 评论(0) 推荐(0)
摘要:改变数组的值 this.$set(this.children,1,666) 遍历改变数组中的对象 let that=this this.children.forEach(function (value,i) { that.$set(value,'aa',true); }); 阅读全文
posted @ 2017-09-07 12:16 fm060 阅读(621) 评论(0) 推荐(0)
摘要:axios({ method: 'post', url: '/zhuang/token', data: get, }).then(function(data){ ling=data.data.data.access_token; console.log(data); setTi... 阅读全文
posted @ 2017-08-04 18:18 fm060 阅读(143) 评论(0) 推荐(0)
摘要:可以用 $nextTick 來確保 Dom 變化後再執行一些事情: 阅读全文
posted @ 2017-07-30 23:39 fm060 阅读(112) 评论(0) 推荐(0)
摘要:装api 获取令牌: 登录: 获取用户信息 阅读全文
posted @ 2017-07-19 14:50 fm060 阅读(397) 评论(0) 推荐(0)
摘要:父页面: 子页面: 阅读全文
posted @ 2017-07-17 23:58 fm060 阅读(338) 评论(0) 推荐(0)
摘要:.fade-enter-active, .fade-leave-active { transition: opacity 10.5s } .fade-enter, .fade-leave-active { opacity: 0 } #div1{width: 500px;he... 阅读全文
posted @ 2017-06-14 17:11 fm060 阅读(213) 评论(0) 推荐(0)
摘要:php: <?php header('Access-Control-Allow-Origin:*'); $date = $_POST['data'];$cars=array("Volvo","BMW","SAAB"); $data = array( 'tid' => 100, 'name' => $ 阅读全文
posted @ 2017-02-28 23:40 fm060 阅读(6081) 评论(0) 推荐(0)
摘要:var example2 = new Vue({ el: '#example-2', data: { name: 'Vue.js' }, // 在 `methods` 对象中定义方法 methods: { greet: function (event) { // `this` 在方法里指当前 Vue 阅读全文
posted @ 2017-01-05 13:44 fm060 阅读(3164) 评论(1) 推荐(0)
摘要:filter {{item}} 加载更多 阅读全文
posted @ 2017-01-04 14:22 fm060 阅读(5330) 评论(1) 推荐(1)
摘要:<div id="example"> <p>{{msg}}</p> <ul> <li v-for="item in msg">{{item.a}} <input type="text" v-on:change="aa" v-model="item.c"> {{item.b}} </li> </ul> 阅读全文
posted @ 2017-01-04 13:56 fm060 阅读(975) 评论(0) 推荐(0)
摘要:<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title></head><body> <div id="main"> {{text}} <textarea v-model="text"></ 阅读全文
posted @ 2017-01-04 13:54 fm060 阅读(2778) 评论(0) 推荐(0)