[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"
```