Skip to content

Commit c639207

Browse files
author
Tenny
committed
fix(MdInput): 修复样式以及输入错误
1 parent 24219fd commit c639207

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/components/input/MdInput.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</template>
2626
<script setup lang="ts">
2727
import { ref, watch } from 'vue';
28-
import { random } from 'ph-utils';
28+
import { random, isBlank } from 'ph-utils';
2929
3030
const el = ref<HTMLInputElement>();
3131
@@ -69,9 +69,7 @@ function handleInputBlur() {
6969
}
7070
7171
watch(modelValue, (v) => {
72-
if (v != null) {
73-
hasValue.value = true;
74-
}
72+
hasValue.value = isBlank(v) ? false : true;
7573
});
7674
7775
defineExpose({

style/md-input/index.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
.nt-md-input__inner {
1010
width: 100%;
1111
height: 100%;
12+
border: 0;
13+
background: transparent;
1214
border-style: solid;
1315
border-color: #c0c0c0;
1416
border-bottom-width: 1px;
@@ -38,7 +40,6 @@
3840
.nt-md-input.nt-focused .nt-md-input__label {
3941
transform: translateY(-150%);
4042
font-size: 12px;
41-
background-color: #fff;
4243
}
4344
.nt-md-input.nt-focused .nt-md-input__label {
4445
color: var(--nt-primary-color, #52c41a);
@@ -60,4 +61,5 @@
6061
.nt-md-input-outline.nt-has-value .nt-md-input__label {
6162
padding-left: 4px;
6263
padding-right: 4px;
64+
background-color: #ffffff;
6365
}

0 commit comments

Comments
 (0)