Commit 75ec7ce 1 parent 87a1314 commit 75ec7ce Copy full SHA for 75ec7ce
File tree 1 file changed +40
-35
lines changed
packages/components/src/preview-text
1 file changed +40
-35
lines changed Original file line number Diff line number Diff line change @@ -32,43 +32,48 @@ export const usePlaceholder = (value?: Ref<any>) => {
32
32
return placeholder
33
33
}
34
34
35
- const Input = defineComponent ( {
36
- name : 'FPreviewTextInput' ,
37
- props : [ 'value' ] ,
38
- setup ( props , { attrs } ) {
39
- const value = toRef ( props , 'value' )
40
- const placeholder = usePlaceholder ( value )
41
- return ( ) => {
42
- return h (
43
- 'div' ,
44
- {
45
- class : [ prefixCls , `${ stylePrefix } -preview-input` ] ,
46
- style : attrs . style ,
47
- attrs : {
48
- ...attrs ,
49
- disabled : false ,
35
+ const Input = observer (
36
+ defineComponent ( {
37
+ name : 'FPreviewTextInput' ,
38
+ props : [ 'value' ] ,
39
+ setup ( props , { attrs } ) {
40
+ const fieldRef = useField < Field > ( )
41
+ const field = fieldRef . value
42
+ const value = toRef ( props , 'value' )
43
+ const placeholder = usePlaceholder ( value )
44
+ return ( ) => {
45
+ return h (
46
+ 'div' ,
47
+ {
48
+ class : [ prefixCls , `${ stylePrefix } -preview-input` ] ,
49
+ style : attrs . style ,
50
+ attrs : {
51
+ ...attrs ,
52
+ ...props ,
53
+ disabled : false ,
54
+ } ,
50
55
} ,
51
- } ,
52
- {
53
- default : ( ) => [
54
- [
55
- h (
56
- 'span' ,
57
- {
58
- class : [ `${ stylePrefix } -preview-input-title` ] ,
59
- } ,
60
- {
61
- default : ( ) => [ attrs . label ] ,
62
- }
63
- ) ,
56
+ {
57
+ default : ( ) => [
58
+ [
59
+ h (
60
+ 'span' ,
61
+ {
62
+ class : [ `${ stylePrefix } -preview-input-title` ] ,
63
+ } ,
64
+ {
65
+ default : ( ) => [ field . title ] ,
66
+ }
67
+ ) ,
68
+ ] ,
69
+ placeholder . value ,
64
70
] ,
65
- placeholder . value ,
66
- ] ,
67
- }
68
- )
69
- }
70
- } ,
71
- } )
71
+ }
72
+ )
73
+ }
74
+ } ,
75
+ } )
76
+ )
72
77
73
78
const Checkbox = observer (
74
79
defineComponent ( {
You can’t perform that action at this time.
0 commit comments