# 動態路由(7-6) ###### tags: `Vue`、`7. Router路由` 2022.3.9   如果使用者在網址後面多加一些參數,管理者可以用動態路由方式抓取值,放進程式中加以操作。 ### 範例  #### 1. 下載 axios ``` npm install axios ``` #### 2. 使用 axios 抓取遠端資料 [隨機用戶生成](https://randomuser.me/)API:https ://randomuser.me/api/ ``` <script> import axios from 'axios'; export default { created() { axios.get('遠端API網址').then((res) => { console.log(res); }); }, }; </script> ```  #### 3. 觀察API模式,帶變數到API網址,獲取特定人員資料。  #### 4. 設置取網址變數值  #### 5. 取得變數索引 
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up