Skip to content

Commit

Permalink
test: update implementation of <ProviderSelector>
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed May 28, 2023
1 parent 52ba7aa commit 295b8c4
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions playground/components/provider-selector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,20 @@
</select>
</template>

<script lang="ts">
<script lang="ts" setup>
import { providers } from '../providers'
export default {
computed: {
providers: () => providers,
providerName: {
get () {
return this.$route.params.provider || ''
},
set (provider) {
if (provider) {
this.$router.push(`/provider/${provider}`)
}
}
const route = useRoute()
const router = useRouter()
const providerName = computed({
get () {
return route.params.provider || ''
},
set (provider) {
if (provider) {
router.push(`/provider/${provider}`)
}
}
}
})
</script>

0 comments on commit 295b8c4

Please sign in to comment.