企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
[TOC] ## 1、怎么定义vue-router的动态路由?怎么获取传过来的动态参数?  > 答:在router目录下的index.js文件中,对path属性加上/:id。  使用router对象的params.id > <router-link :to\="'/detail/'+item.id"> ## 2. vue怎么获取dom > 利用Vue提供的ref属性以及this.$refs即可实现 ``` <button ref="btn">获取ref</button> this.$refs.btn.style.backgroundColor="#ff0000" ```