Created
December 20, 2018 11:21
-
-
Save wicksome/727d5f81150579d1625f8be40ca57f3d to your computer and use it in GitHub Desktop.
Bind router state to the radio button in vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <input | |
| :checked="$route.name === 'groups'" | |
| type="radio" | |
| @change="$router.push({name: 'groups'})" | |
| > | |
| <input | |
| :checked="$route.name === 'groups-member'" | |
| type="radio" | |
| @change="$router.push({name: 'groups-member'})" | |
| > | |
| <input | |
| :checked="$route.name === 'groups-master'" | |
| type="radio" | |
| @change="$router.push({name: 'groups-master'})" | |
| > | |
| </template> | |
| <script> | |
| export default { | |
| name: "RadioButtonBindWithRoute", | |
| } | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment