Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHamidreza Ghavami <hamid.r.gh.1998@gmail.com>2023-05-08 17:51:58 +0300
committerHamidreza Ghavami <hamid.r.gh.1998@gmail.com>2023-05-08 17:51:58 +0300
commitf553922d5363fe63dd485f8cbaa7f56178a640cc (patch)
tree538411f00cff66cdd309a7f8845be48b2715e733
parent7b2764566c010aabb2b21dde200d0021fffb409d (diff)
add password component
-rw-r--r--web/html/xui/component/password.html35
1 files changed, 35 insertions, 0 deletions
diff --git a/web/html/xui/component/password.html b/web/html/xui/component/password.html
new file mode 100644
index 00000000..ebea3be6
--- /dev/null
+++ b/web/html/xui/component/password.html
@@ -0,0 +1,35 @@
+{{define "component/passwordInput"}}
+<template>
+ <a-input :value="value" :type="showPassword ? 'text' : 'password'"
+ :placeholder="placeholder"
+ @input="$emit('input', $event.target.value)">
+ <template v-if="icon" #prefix>
+ <a-icon :type="icon" :style="'font-size: 16px;' + themeSwitcher.textStyle" />
+ </template>
+ <template #addonAfter>
+ <a-icon :type="showPassword ? 'eye-invisible' : 'eye'"
+ @click="toggleShowPassword"
+ :style="'font-size: 16px;' + themeSwitcher.textStyle" />
+ </template>
+ </a-input>
+</template>
+{{end}}
+
+{{define "component/password"}}
+<script>
+ Vue.component('password-input', {
+ props: ["title", "value", "placeholder", "icon"],
+ template: `{{template "component/passwordInput"}}`,
+ data() {
+ return {
+ showPassword: false,
+ };
+ },
+ methods: {
+ toggleShowPassword() {
+ this.showPassword = !this.showPassword;
+ },
+ },
+ });
+</script>
+{{end}} \ No newline at end of file