Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Readme
ucid is a Vue.js mixin that adds a unique ID to some of your components. Unique identifiers are required for labels, ARIA and other things. ucid is based on this issue.
Install it:
npm i ucid
Then add it to your component(s) that need(s) a unique ID.
ucid
is identical within one component and unique over all other components (including siblings and child components).
<template>
<!-- example usage -->
<div :id="'test-' + ucid">{{ucid}}</div>
</template>
<script>
import ucid from 'ucid';
export default {
mixins: [
ucid,
],
mounted() {
// example usage
console.log('ID:', this.ucid);
},
};
</script>
ucid is a Vue.js mixin.
Every component, that extends its own functionality with ucid will get a local property called ucid
.
It is defined within the beforeCreate
hook (see lifecycle diagram) of ucid.
_uid
?The vm
_uid
is reserved for internal use and it's important to keep it private (and not rely on it in user code) so that we keep the flexibility to change its behavior for potential future use cases.
ucid
, not $ucid
?The $
prefix is a convention of instance properties.
$
is a convention Vue uses for properties that are available to all instances.
ucid
is not available to all instances.
It is just a mixin that extends functionality of some components that you choose.
FAQs
Vue.js mixin to get unique component IDs.
The npm package ucid receives a total of 1 weekly downloads. As such, ucid popularity was classified as not popular.
We found that ucid demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.