File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
packages/component/component/tagInput Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -193,4 +193,16 @@ describe("LayTagInput", () => {
193
193
expect ( ( component . vm as any ) . oldCompositionValue ) . toBe ( "H" ) ;
194
194
expect ( component . findAll ( ".layui-tag-text" ) . length ) . toBe ( 2 ) ;
195
195
} ) ;
196
+
197
+ test ( "inputValue 初始化反填" , async ( ) => {
198
+ const wrapper = mount ( LayTagInput , {
199
+ props : {
200
+ inputValue : "123" ,
201
+ } ,
202
+ } ) ;
203
+
204
+ const component = wrapper . findComponent ( LayTagInput ) ;
205
+ const inputInstance = component . find ( "input" ) ;
206
+ expect ( inputInstance . element . value ) . toBe ( "123" ) ;
207
+ } ) ;
196
208
} ) ;
Original file line number Diff line number Diff line change @@ -312,6 +312,10 @@ onMounted(() => {
312
312
handleResize ();
313
313
const treeSelectContext = useTreeSelectProvide ();
314
314
treeSelectContext ?.setInputEl ?.(inputRefEl .value as HTMLInputElement );
315
+
316
+ if (inputRefEl .value ) {
317
+ inputRefEl .value ! .value = inputValue .value ;
318
+ }
315
319
});
316
320
317
321
defineExpose ({
You can’t perform that action at this time.
0 commit comments