vue project
Use the label label for to an input (file upload)
There is a component in the label
Clicking the component does not call the input upload
I wrote another label and typed it in it casually After a few words
can be called input after clicking
What is the problem?
The following cannot be called
<file-upload id="headUpload" :target="uploadUrl" action="POST" v-on:progress="progress" v-on:start="startUpload" v-on:finish="finishUpload" class="uploadBox"></file-upload>
<view-box ref="viewBox">
<label for="headUpload">
<group gutter="0" style="display:block; overflow:hidden">
<cell value="修改头像" link="#headUpload">
<img slot="icon" width="50" style="display:block;margin-right:5px;border-radius:50%" :src="user.head">
</cell>
</group>
</label>
...
If it is like the following, you can call
<file-upload id="headUpload" :target="uploadUrl" action="POST" v-on:progress="progress" v-on:start="startUpload" v-on:finish="finishUpload" class="uploadBox"></file-upload>
<view-box ref="viewBox">
<label for="headUpload">12313131313123132</label>
<group gutter="0" style="display:block; overflow:hidden">
<cell value="修改头像" link="#headUpload">
<img slot="icon" width="50" style="display:block;margin-right:5px;border-radius:50%" :src="user.head">
</cell>
</group>
...
Why is this component structure so messy
Put label outside file-upload and try it side by side with file-upload