因马虎犯的vue小错误

  • TypeError: Cannot read property '0' of undefined(0未定义)
  • 后来发现获取图片时,将files搭成了file
  • 正确写法
//获取图片方法
let img = document.getElementById('img').files[0];
落后就要吃土,努力吧,骚年!!!
原文地址:https://www.cnblogs.com/u-damowang1/p/12143609.html