Why vue uses with statements that are not supported in es5 strict mode

two functions in the source code

function() {
    with(this){return _c("div")}
}

Vue.prototype._c , just to omit this , isn"t there a performance problem with with , and strict mode is not supported.

Feb.27,2021

first of all, the writing of the source code can still be executed normally in strict mode, and then there is official explanation :

  • to reduce compiler code size and complexity
  • provides vue-loader as a way to compile template into render
  • through a build tool.
Menu