Skip to content

Instantly share code, notes, and snippets.

@sadewole
Last active January 25, 2022 09:00
Show Gist options
  • Save sadewole/baae1e5245d08a01431c2ac7e88621af to your computer and use it in GitHub Desktop.
Save sadewole/baae1e5245d08a01431c2ac7e88621af to your computer and use it in GitHub Desktop.
AccordionItem.vue - Script: Util func.
<script lang="ts">
... // content hidden
function useId(size = 3): string {
let randomId = "";
const dictionary = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
for (let i = 0; i < size; i++) {
randomId += dictionary.charAt(
Math.floor(Math.random() * dictionary.length)
);
}
return randomId;
}
export default defineComponent({
name: "AccordionItem",
... // content hidden
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment