What is the meaning and principle of pseudo trigger in js?

< input type= "file" v show = "1" accept= "image" ref= "input" @ change= "fileChange ($event.target.files)" >
< span @ click= "$refs.input.click ()" class= "select-photo" > Select a picture

$refs.input.click()

is there an official explanation?

Mar.23,2021

The

principle is that using ref in
vue, you can get a click event of an element similar to a native getElementById; in js and triggered by element.click in js (provided that this element supports click events).

reference:
ref get element
https://cn.vuejs.org/v2/api/-sharpref
element.click()
https://developer.mozilla.org.

Menu