Subscribe on changes!

loop varible is undefined in inline anonymous function in template

avatar
May 20th 2023

It was compiled to ...

_createVNode(__import_1__.default, {
      text: "BUG",
      onSelectFiles: _cache[0] || (_cache[0] = 
      (a) => {
        for (const file of a.files) {
          _unref(log)('aa', _ctx.file.name);
        }
      }
    )//...

renaming file to other variables does not change behavior. Vue probably didn't pick up that this is a local variable and instead assumes all vars are on _ctx