File chooser dialog can only be shown with a user activation.

使用vue开发时,通过ref通过“this.refs.[name].$el.click()”触发按钮时提示“File chooser dialog can only be shown with a user activation.”,按钮不能触发,网上解决办法是“dispatchEvent(new MouseEvent('click'))”代替“$el.click()”,在我所在的场景不生效,所以就在要出发按钮组件上加了一个id,按钮可以正常触发了




你可能感兴趣的:(vue.js,javascript,前端)