javascript - vue label has no effect if it contains a component
伊谢尔伦
伊谢尔伦 2017-06-15 09:21:56
0
1
893

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>
      ...
伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(1)
迷茫

Why is this component structure so messy

Put label outside file-upload and try it side by side with file-upload

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template