【原】vue-router中params和query的区别
vue.js获取dom元素高度的方法
<div ref="test"></div> let testHeight = this.$refs.test.offsetHeight
vue.js中内联样式style、class三元表达式
//style三元表达式
<div :style="{'color': (isActive? '#000':'#fff')}"></div> //class三元表达式
<div:class="[isActive ? 'test1' : 'test2']"></div>
vue-router中params和query的区别
1.引入方式不同
this.$router.push({
path: 'test',
query: {
type: 2,
detail: '哈哈'
}
})
params要用name来引入
this.$router.push({
name: 'test',
params: {
type: 2,
detail: '哈哈'
}
})
2.url不同
query在url中显示参数,类似的get请求
http://localhost:8080/detail?type=0&detail=哈哈
http://localhost:8080/detail
$router和$route的区别
this.$route为当前router跳转对象里面可以获取name、path、query、params等
this.$router为VueRouter实例,导航到不同URL,可使用this.$router.push()、this.$router.replace()、this.$router.go()
打印下this.$route和this.$router

vue中this.$set的用法
向响应式对象中添加一个属性,并确保这个新属性同样是响应式的,且触发视图更新
https://www.jianshu.com/p/6f28f5abee08
简单理解Vue中的nextTick
在数据变化后要执行的某个操作,而这个操作需要使用随数据改变而改变的DOM结构的时候,这个操作都应该放进Vue.nextTick()的回调函数中
https://www.jianshu.com/p/a7550c0e164f
带有 slot attribute 的具名插槽(废弃了的语法)
https://cn.vuejs.org/v2/guide/components-slots.html#%E4%BD%9C%E7%94%A8%E5%9F%9F%E6%8F%92%E6%A7%BD
带有 slot-scope attribute 的作用域插槽(废弃了的语法)
【原】vue-router中params和query的区别的更多相关文章
- vue路由传值params和query的区别
vue路由传值params和query的区别1.query传参和接收参数传参: this.$router.push({ path:'/xxx' query:{ id:id } })接收参数: this ...
- Vue Router的params和query传参的使用和区别
vue页面跳转有两种方式分别是:name和path this.$router.push({name: 'HelloWorld2}) this.$router.push({path: '/hello-w ...
- Vue router中携带参数与获取参数
Vue router中携带参数与获取参数 携带参数 query方式,就是?+&结构,例如/login?id=1 <router-link :to="{ name:'login' ...
- $router和$route的区别,路由跳转方式name 、 path 和传参方式params 、query的区别
一.$router和$route的区别 $router : 是路由操作对象,只写对象$route : 路由信息对象,只读对象 例子://$router操作 路由跳转 this.$router.push ...
- vue 项目中assets 和static的区别
一.Webpacked Assets 为了回答这个问题,我们首先需要了解Webpack如何处理静态资产.在 *.vue 组件中,所有模板和CSS都会被 vue-html-loader 及 css-lo ...
- vue router 中,children 中 path 为空字符串的路由,是默认打开的路由(包括在 el-tabs 中嵌套路由的情况)
详见该页面的最后一个代码块:https://router.vuejs.org/zh/guide/essentials/nested-routes.html#%E5%B5%8C%E5%A5%97%E8% ...
- .params和query的区别
用法:query要用path来引入,params要用name来引入,接收参数都是类似的,分别是this.$route.query.name和this.$route.params.name.url地址显 ...
- Vue.js中 computed 和 methods 的区别
官方文档中已经有对其的解释了,在这里把我的理解记录一下Vue中的methods.watch.computed computed 的使用场景 HTML模板中的复杂逻辑表达式,为了防止逻辑过重导致不易维护 ...
- 【原】iOS中KVC和KVO的区别
在iOS开发中经常会看到KVC和KVO这两个概念,比较可能混淆,特地区分一下 KVC(Key Value Coding) 1> 概述 KVC:Key Value Coding,键值编码,是一种间 ...
随机推荐
- windows2012获取明文密码
windows 2012获取明文密码 导hash的话用常规的方法就可以. 修改注册表 reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contr ...
- kbmMemTable中怎么根据UniqueRecID定位到对应的记录
function TForm5.LocateUniqueRecID(aDataSet: TkbmMWCustomClientQuery; AID: TkbmNativeInt): Boolean; v ...
- 读书笔记《SpringBoot编程思想》
目录 一. springboot总览 1.springboot特性 2.准备运行环境 二.理解独立的spring应用 1.应用类型 2.@RestController 3.官网创建springboot ...
- java学习之—二叉树
package com.data.java.towtree; import java.io.IOException; /** * 二叉树 * @Title: uminton */ class Node ...
- Creating a PXE Configuration File
The PXE configuration file defines the menu displayed to the pxe client host as it boots up and co ...
- Delphi MSComm控件属性
- 解决 Grep 的多次管道过滤问题
解决 Grep 的多次管道过滤问题 这是个问题,解决了 tail -f crazy.log | grep --line-buffered Hello | grep Time 解决 Grep 的多次管道 ...
- 简单粗暴 每个servlet之前都插入一段代码解决 乱码问题
response.setHeader("content-type", "text/html;charset=UTF-8"); response.setChara ...
- RHEL7 网口绑定Network Teaming
1.选择Networking Teaming配置方法 使用文本用户界面工具nmtui 使用命令行工具nmcli 使用ifcfg配置文件创建网络成组 使用图形用户界面配置网络成组 2.了解主接口 ...
- MySQL查询数据库中所有数据表的数据条数
select table_name,table_rows from information_schema.tables where TABLE_SCHEMA = '数据库名称' order by ta ...