Skip to content

Commit 0fc10e3

Browse files
committed
函数框使用label显示内容
1 parent 6e236a4 commit 0fc10e3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/editor/inputs/subblocks/function.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<template>
22
<div class="filled-textfield" :class="{ focus: isFocus }">
3-
<label :class="{ lifted: !isEmpty }">{{ props.label }}</label>
3+
<label :class="{ lifted: !isEmpty }">{{
4+
isEmpty ? props.label : value
5+
}}</label>
46
<input
57
@focus="isFocus = true"
68
@blur="isFocus = false"
@@ -62,7 +64,7 @@ watch(value, refreshInput);
6264
caret-color: var(--s-color-primary);
6365
line-height: 1.2;
6466
z-index: 1;
65-
color: var(--s-color);
67+
color: transparent;
6668
}
6769
label {
6870
color: var(--s-color-outline);
@@ -77,7 +79,7 @@ watch(value, refreshInput);
7779
transform: translateY(-0.05em);
7880
}
7981
label.lifted {
80-
opacity: 0;
82+
color: var(--s-color);
8183
}
8284
}
8385
</style>

0 commit comments

Comments
 (0)