VUE中File属性Input无法触发@change事件

    由于要调整上传界面样式,所以需要隐藏自带的input元素,这里使用display:none控制,但是通过jquery$触发click事件后无法触发change事件。
    解决方法:
为input元素添加ref属性:
<input ref="myFile" type="file"  style="display: none;" @change="choiceModelFile">
再通过以下代码触发click事件即可。
this.$refs.myFile.click();
此时input框可正常触发@change事件。

作者:徐先森 文章名: 《VUE中File属性Input无法触发@change事件》
收录情况: 百度已收录
版权说明:若无特别注明,本文皆为 "徐博客”原创,转载请保留出处!

相关推荐

发表评论

路人甲
看不清楚?点图切换 Ctrl+Enter快速提交

网友评论(554)

<a href="https://prozacflx.com/">prozac india price</a>
Janesmath 约11小时前 回复
<a href="https://clonidinenorx.com/">pill clonidine</a>
Janesmath 约12小时前 回复
<a href="https://erythromycinlab.com/">erythromycin capsules</a> <a href="https://accutanisotretinoin.com/">buy generic accutane 40 mg</a> <a href="https://nolvadex10.com/">cheap nolvadex for sale</a> <a href="https://backtrim.com/">bactrim tablet online</a> <a href="https://azithromycinp.com/">can i buy azithromycin online usa</a> <a href="https://baclofenp.com/">10mg baclofen</a> <a href="https://sildalistab.com/">cheap sildalis</a> <a href="https://proscar40.com/">generic proscar cost</a> <a href="https://avodart24.com/">avodart buy canada</a> <a href="https://amoxicillinab.com/">amoxicillin otc canada</a>
Suesmath 约13小时前 回复
<a href="https://allopurinol24.com/">allopurinol online canada</a> <a href="https://ampicillin24.com/">ampicillin 24 g</a> <a href="https://ciproflxn.com/">1000 mg cipro</a> <a href="https://clomid150.com/">where can you buy clomid</a> <a href="https://hydrochlorothiazide2.com/">hydrochlorothiazide 37.5</a> <a href="https://robaxin24.com/">generic robaxin 500mg</a> <a href="https://zofranondansetron.com/">zofran coupon</a> <a href="https://silagratab.com/">buy silagra uk</a> <a href="https://estrace2.com/">buy estrace cream online</a> <a href="https://fluoxetinetb.com/">order fluoxetine online</a> <a href="https://finasteridealop.com/">finasteride canada pharmacy</a> <a href="https://levitratab.com/">10mg levitra online</a> <a href="https://disulfiram.us.com/">disulfiram brand name in india</a> <a href="https://tretinoin365.com/">tretinoin over the counter mexico</a> <a href="https://toradoliv.com/">toradol back pain</a> <a href="https://viagra2019.com/">generic viagra on line</a> <a href="https://cytotec100.com/">cytotec 200</a> <a href="https://lopressormetoprolol.com/">50 mg lopressor</a> <a href="https://motilium10mg.com/">motilium 10mg canada</a> <a href="https://flagyl24.com/">generic flagyl generic flagyl</a>
Ivysmath 约14小时前 回复
buy propecia no prescription <a href=" http://propeciafavdr.com/# ">propecia prescription</a> propecia tablets http://propeciafavdr.com/ finasteride medication <a href=http://propeciafavdr.com/#>propecia</a> purchase propecia no prescription
valtrex daily use <a href=" http://valtrex10.com/# ">where to buy valtrex online</a> how to buy valtrex in korea http://valtrex10.com/ valtrex in australia <a href=http://valtrex10.com/#>how to order valtrex</a> cheapest on line valtrex without a prescription
buy wellbutrin in australia <a href=" http://wellbutrin100.com/# ">150 wellbutrin</a> no prescription wellbutrin online http://wellbutrin100.com/ best prices for wellbutrin <a href=http://wellbutrin100.com/#>wellbutrin brand name cost</a> wellbutrin 10 mg
JosephNaf 约14小时前 回复
valtrex coupon canada <a href=" http://valtrex10.com/# ">cost of valtrex in india</a> valtrex without prescription http://valtrex10.com/ where can i order valtrex <a href=http://valtrex10.com/#>valtrex rx cost</a> valtrex prices
wellbutrin xl 300 mg generic <a href=" http://wellbutrin100.com/# ">generic wellbutrin us</a> best generic wellbutrin http://wellbutrin100.com/ order wellbutrin online from canada <a href=http://wellbutrin100.com/#>wellbutrin 150 xl</a> wellbutrin price without insurance
how do i get valtrex <a href=" http://valtrex10.com/# ">valtrex mexico</a> cost for generic valtrex http://valtrex10.com/ buy valtrex online in usa <a href=http://valtrex10.com/#>valtrex medication for sale</a> discount valtrex online
Ronaldmag 约17小时前 回复
<a href="https://flagyl24.com/">flagyl 500 mg tablet price</a> <a href="https://albenzamed.com/">albenza cost in mexico</a> <a href="https://cytotec100.com/">cytotec medication</a> <a href="https://prozacflx.com/">how much is prozac 20</a> <a href="https://zoloft360.com/">zoloft cheapest price</a> <a href="https://viagrasoftab.com/">viagra soft tabs 50mg</a> <a href="https://tetracyclinecaps.com/">tetracycline tablets 100mg</a> <a href="https://elimitepermethrin.com/">where can i buy elimite cream</a> <a href="https://fluoxetinetb.com/">fluoxetine capsules 20mg</a> <a href="https://colchicine5.com/">colchicine 0.6mg capsules generic</a> <a href="https://lopressormetoprolol.com/">lopressor 10 mg</a> <a href="https://furosemide1.com/">buy furosemide online usa</a> <a href="https://disulfiram.us.com/">antabuse prices</a> <a href="https://azithromycinp.com/">order azithromycin 500mg</a> <a href="https://augmentin875.com/">augmentin brand cost</a> <a href="https://chloroquineav.com/">aralen otc</a> <a href="https://silagratab.com/">silagra tablets</a> <a href="https://lasixwtp.com/">lasix online uk</a> <a href="https://acyclovirzov.com/">buying acyclovir</a> <a href="https://wellbutrin24.com/">cheap wellbutrin xl</a>
Alansmath 约23小时前 回复
<a href="http://singulair.us.com/">purchase generic singulair</a> <a href="http://arimidex365.com/">how much is arimidex cost</a> <a href="http://clonidinenorx.com/">clonidine buy online canada</a> <a href="http://levitratab.com/">levitra otc</a> <a href="http://cephalexin911.com/">keflex 250 mg</a>
Densmath 约23小时前 回复
<a href="https://viagrasoftab.com/">viagra soft 100mg</a> <a href="https://prednisonesr.com/">buy cheap prednisone online</a> <a href="https://inderal.us.com/">inderal over the counter australia</a> <a href="https://lasixwtp.com/">lasix online order</a> <a href="https://cephalexin911.com/">medicine cephalexin</a> <a href="https://proscar40.com/">proscar price australia</a> <a href="https://baclofenp.com/">baclofen over the counter usa</a> <a href="https://tadalafilm.com/">tadalafil 40</a> <a href="https://clomid150.com/">clomid infertility</a> <a href="https://prazosin.us.com/">prazosin generic drug</a> <a href="https://zithromax360.com/">zithromax 250 mg price</a> <a href="https://disulfiram.us.com/">buy disulfiram tablets</a> <a href="https://toradoliv.com/">toradol for pain</a> <a href="https://levitratab.com/">30 mg levitra</a> <a href="https://stratterra.com/">strattera nz</a> <a href="https://clonidinenorx.com/">where can you get clonidine</a> <a href="https://acyclovirzov.com/">acyclovir tablets</a> <a href="https://cymbaltarx.com/">cymbalta for sale</a> <a href="https://ivaltrex.com/">order valtrex generic</a> <a href="https://hydrochlorothiazide2.com/">how much is hydrochlorothiazide</a>
Ivysmath 1天前 回复
<a href="https://paxil10.com/">paxil for depression and anxiety</a>
Kimsmath 1天前 回复
1 2 3 4 5 6 ... »