11.23-11.27
# 11.23-11.27汇总
## 1.el-table多行合并+表格行内联动多选+三级选择
这个花费了很长时间,所需要的功能都复现做了一个出来,记录在自己的CSDN博客上面,以后有机会可以思索一下多级递归怎么去实现。
[el-table多行合并+表格行内联动多选+三级选择](https://blog.csdn.net/weixin_42273491/article/details/110002089)
## 2.js数组判断某个元素有无在数组中
可以用indexOf,如果某个元素在数组中,那么就会返回该元素在数组中的位置,没有就返回-1
## 3.Vue Router 的params和query传参的使用和区别
$router和$route的区别
```js
//$router : 是路由操作对象,只写对象
//$route : 路由信息对象,只读对象
//操作 路由跳转
this.$router.push({
name:'hello',
params:{
name:'word',
age:'11'
}
})
//读取 路由参数接收
this.name = this.$route.params.name;
this.age = this.$route.params.age;
```
query传递参数
```js
//query传参,使用name跳转
this.$router.push({
name:'second',
query: {
queryId:'20180822',
queryName: 'query'
}
})
//query传参,使用path跳转
this.$router.push({
path:'second',
query: {
queryId:'20180822',
queryName: 'query'
}
})
//query传参接收
this.queryName = this.$route.query.queryName;
this.queryId = this.$route.query.queryId;
```
params传递参数
```js
//params传参 使用name
this.$router.push({
name:'second',
params: {
id:'20180822',
name: 'query'
}
})
//params接收参数
this.id = this.$route.params.id ;
this.name = this.$route.params.name ;
//路由
{
path: '/second/:id/:name',
name: 'second',
component: () => import('@/view/second')
}
```