@neatui/nuxt 1.6.6 → 1.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -217,7 +217,8 @@
|
|
|
217
217
|
// 创建日期
|
|
218
218
|
const cDate = (date: any = null) => {
|
|
219
219
|
const normalized = normalizeDateInput(date);
|
|
220
|
-
|
|
220
|
+
// iOS 兼容:Safari 不支持 "YYYY-MM-DD" 格式,需要替换为 "YYYY/MM/DD"
|
|
221
|
+
return isDateString(normalized) ? new Date(normalized?.replace(/-/g, '/')) : new Date();
|
|
221
222
|
};
|
|
222
223
|
|
|
223
224
|
// 快捷预设
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<input
|
|
18
18
|
:title="props.modelValue"
|
|
19
19
|
:value="props.modelValue"
|
|
20
|
-
:type="
|
|
20
|
+
:type="type"
|
|
21
21
|
:placeholder="placeholder"
|
|
22
22
|
:disabled="disabled"
|
|
23
23
|
:readonly="readonly"
|
|
@@ -30,12 +30,6 @@
|
|
|
30
30
|
</slot>
|
|
31
31
|
<div ui-form-suffix="">
|
|
32
32
|
<i ui-form-clean="" v-if="clearable && props.modelValue && !readonly && !disabled" @click.stop="clear"></i>
|
|
33
|
-
<div
|
|
34
|
-
class="o-ls"
|
|
35
|
-
v-if="type === 'password' && cipher"
|
|
36
|
-
:ui-form-cipher="cipherVisible ? '1' : ''"
|
|
37
|
-
@click.stop="toggleCipher"
|
|
38
|
-
></div>
|
|
39
33
|
<slot name="suffix"></slot>
|
|
40
34
|
<template v-for="(item, idx) in suffix" :key="idx">
|
|
41
35
|
<div v-if="isObject(item)" v-bind="item.attrs" v-on="event(item, props.modelValue)">
|
|
@@ -49,7 +43,7 @@
|
|
|
49
43
|
</template>
|
|
50
44
|
|
|
51
45
|
<script setup lang="ts">
|
|
52
|
-
import {
|
|
46
|
+
import { reactive, watch } from 'vue';
|
|
53
47
|
import { isObject, isFunction } from '@fekit/utils';
|
|
54
48
|
|
|
55
49
|
const emits = defineEmits(['update:modelValue', 'click', 'blur', 'focus', 'change', 'input', 'clear']);
|
|
@@ -95,7 +89,6 @@
|
|
|
95
89
|
disabled?: boolean;
|
|
96
90
|
readonly?: boolean;
|
|
97
91
|
clearable?: boolean;
|
|
98
|
-
cipher?: boolean;
|
|
99
92
|
verify?: boolean;
|
|
100
93
|
prefix?: Array<any>;
|
|
101
94
|
suffix?: Array<any>;
|
|
@@ -117,7 +110,6 @@
|
|
|
117
110
|
disabled: false,
|
|
118
111
|
readonly: false,
|
|
119
112
|
clearable: true,
|
|
120
|
-
cipher: true,
|
|
121
113
|
verify: false,
|
|
122
114
|
prefix: () => [],
|
|
123
115
|
suffix: () => [],
|
|
@@ -132,14 +124,6 @@
|
|
|
132
124
|
// 错误
|
|
133
125
|
error: {},
|
|
134
126
|
});
|
|
135
|
-
const cipherVisible = ref(false);
|
|
136
|
-
|
|
137
|
-
const inputType = computed(() => {
|
|
138
|
-
if (props.type === 'password') {
|
|
139
|
-
return cipherVisible.value ? 'text' : 'password';
|
|
140
|
-
}
|
|
141
|
-
return props.type;
|
|
142
|
-
});
|
|
143
127
|
// 外部传入交互标识,主要用于外部没有输入但点击了提交,或表单提交成功后重置状态
|
|
144
128
|
watch(
|
|
145
129
|
() => props.interacted,
|
|
@@ -215,11 +199,6 @@
|
|
|
215
199
|
emits('update:modelValue', null);
|
|
216
200
|
emits('clear');
|
|
217
201
|
}
|
|
218
|
-
|
|
219
|
-
const toggleCipher = () => {
|
|
220
|
-
if (props.disabled || props.readonly) return;
|
|
221
|
-
cipherVisible.value = !cipherVisible.value;
|
|
222
|
-
};
|
|
223
202
|
// 输入
|
|
224
203
|
const input = (e: any) => {
|
|
225
204
|
// 用户交互
|
|
File without changes
|