1,for循环

<li @click="toService(type, index)" v-for="(type,index) in typeList" :key="index" class="one_key_type_li">
{{type.serviceTypeName}}
</li>

2,route带参数

this.$router.push({
name: "ServiceSelect",
query: {
serviceTypeId: type.serviceTypeId,
serviceTypeName: type.serviceTypeName
}
}); //接收query参数

created() {
    this.type = this.$route.query.serviceTypeId;

  }

// 标签跳转
<router-link to="/Oncekey">
<span>跳转</span>
</router-link> 

3,渲染后执行

this.$nextTick(() => {
setTimeout(function() {
document.getElementById("m" + id).focus();
}, 200);
});

4,store简单使用

// store.js
import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);
export default new Vuex.Store({
state: {
onceKeyId: ""
},
mutations: {
alterOnceKeyId(state, id) {
state.onceKeyId = id;
}
}
}); //获取id
this.$store.state.onceKeyId
//修改id
this.$store.commit('alterOnceKeyId', "2342");

5,transition动画

<transition name="slide-fade">
<ul v-if="typeList">
动画出现
</ul>
</transition> /* 可以设置不同的进入和离开动画 */
.slide-fade-enter-active {
transition: all .3s ease;
}
/*.slide-fade-leave-active {
transition: all .2s cubic-bezier(1.0, 0.5, 0.8, 1.0);
}*/
.slide-fade-enter, .slide-fade-leave-to
/* .slide-fade-leave-active for below version 2.1.8 */ {
transform: translateX(10px);
opacity: 0;
}

.fade-enter-active{
  transition: opacity .6s;
 }
 .fade-enter{
  opacity: .5;
 }

最新文章

  1. 【ssh信任关系】解决信任关系不生效问题
  2. 深入理解CSS线性渐变linear-gradient
  3. 极光推送 JPush 项目简单使用
  4. angular的post请求,SpringMVC后台接收不到参数值的解决方案
  5. JS中的专业术语
  6. DEV:GridControl 筛选复选框 Checked Dropdown更改数据源
  7. 封装pdo单例模式类
  8. [jobdu]不用加减乘除做加法
  9. 详解Linux chgrp和chown命令的用法
  10. UVA - 11624 多点bfs [kuangbin带你飞]专题一
  11. linux 用户空间与内核空间——高端内存详解
  12. bzoj4361 isn(树状数组优化dp+容斥)
  13. Java Bug -- java.util.ConcurrentModificationException
  14. Oracle数据库入门——目录结构
  15. SQL 2016 AlwaysOn 无域AlwaysOn配置要点
  16. one-hot句子向量 对比度增强
  17. libopencv_shape.so.3.0: cannot open shared object file: No such file or directory 解决笔记
  18. YLZ开发后端外网编写
  19. linux键盘驱动
  20. 关于Google Android平台的ClockworkMod Recovery恢复模式

热门文章

  1. css 关闭按钮实现
  2. Java设计模式—组合模式
  3. C++学习笔记(8)----C++类的大小
  4. Android GridView显示SD卡的图片
  5. this keyword details
  6. 三、angularjs上传图片
  7. 理解JMeter聚合报告(Aggregate Report)
  8. 小程序UI
  9. Attribute+Reflection,提高代码重用
  10. CentOS随笔 - 6.CentOS7安装Git服务器