router
router copied to clipboard
fix(types): normalized Query can have undefined properties
When a query param is not present the query value is undefined, but the type is only string | null.
Here is the extract of code where I had this problem:
const route = useRoute();
const sortBy = ref(route.query.sort_by.toString())
I got Cannot read property 'toString' of undefined but the linter didn't give any errors.
Deploy Preview for vue-router canceled.
| Name | Link |
|---|---|
| Latest commit | 41cb32949f4eeb0b6c360049ec3d58aba5e81c89 |
| Latest deploy log | https://app.netlify.com/sites/vue-router/deploys/62f3d2f9467bdd0008557e03 |