change事件不触发了?

<div class="modal-footer ">

      <!-- Button -->
        <button type="button" class="btn btn-danger-soft me-2" data-bs-dismiss="modal">取消</button>
        <button class="btn btn-danger-soft me-2" type="button" onclick="file.click()"><input type="file" name="file" id="file" style="display:none" @change="Upload"/><i class="bi bi-pencil-fill pe-1"></i> 上传任务文件</button>
    </div>

此时的Upload方法不会被触发为什么?怎么样修改让它触发

阅读 1.5k
1 个回答

label标签,也无需click

<label>
    <input type="file" onchange="change">
</label>
推荐问题