Skip to content
This repository was archived by the owner on Dec 13, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions source/components/other-utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,23 @@ window.addEventListener(
)
```

Vue SFV example:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did u mean SFC?

```
<template>
<q-input @keyup="save(submission)" v-model="submission" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for completeness, it would be better as @keyup="() => { save(submission) }

</template
<script>
export default {
import { debounce } from 'quasar'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import statement inside the export generates error. it should be outside of the exported object.

methods: {
save: debounce(function(field, value) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're calling the "save" method with one parameter only (the value), but it's definition has two parameters, out of which the first one is the "field"

console.log(value);
}, 300 /*ms to wait*/)
}
}
</script>
```

## Throttle Function
Throttling enforces a maximum number of times a function can be called over time. As in "execute this function at most once every X milliseconds."

Expand Down