Skip to content

Password

Basic usage

View Source
vue
<script setup lang="ts">
import { ref } from "vue";
import { UniPassword } from "unify-ui";

const value = ref("");
</script>

<template>
  <UniPassword v-model="value"></UniPassword>
</template>

Placeholder

View Source
vue
<script setup lang="ts">
import { ref } from "vue";
import { UniPassword } from "unify-ui";

const value = ref("");
</script>

<template>
  <UniPassword v-model="value" placeholder="Please enter password"></UniPassword>
</template>

Disabled

View Source
vue
<script setup lang="ts">
import { ref } from "vue";
import { UniPassword } from "unify-ui";

const value = ref("");
</script>

<template>
  <UniPassword v-model="value" disabled></UniPassword>
</template>

API

Properties

ts
const props = withDefaults(
  defineProps<{
    modelValue?: string;
    disabled?: boolean;
    placeholder?: string;
  }>(),
  {
    modelValue: "",
    placeholder: "",
  }
);

Events

ts
defineEmits<{
  (e: "update:modelValue", value: string): void;
  (e: "input", value: string): void;
  (e: "change", value: string): void;
}>();

Released under the MIT License.