Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a function named "render" in a template breaks everything #23

Closed
ricochet1k opened this issue Jun 20, 2018 · 0 comments
Closed

Using a function named "render" in a template breaks everything #23

ricochet1k opened this issue Jun 20, 2018 · 0 comments

Comments

@ricochet1k
Copy link

ricochet1k commented Jun 20, 2018

Because of this line, if I have a template which includes something like {{render(data)}} I get weird errors in the console.

[Vue warn]: Error in render: "TypeError: _vm is undefined"

found in

---> <App>
       <Root> vue.runtime.esm.js:56:2
TypeError: "_vm is undefined"
render   http://localhost:1234/main.a1fcaaae.js:11645:7
render   http://localhost:1234/main.a1fcaaae.js:11659:24

Relevant lines in the generated JS source:

/* template */
        Object.assign($ec0164, (function () {
          var render = function() {
  var _vm = this
  var _h = _vm.$createElement
  var _c = _vm._self._c || _h
  return _c("div", { attrs: { id: "app" } }, [
    _vm._v("\n" + _vm._s(render(_vm.data)) + "\n")
  ])
}
var staticRenderFns = []
render._withStripped = true

          return {
            render: render,
            staticRenderFns: staticRenderFns,
            _compiled: true,
            _scopeId: null,
            functional: undefined
          };
        })());

As you can see, it is calling render(_vm.data) instead of _vm.render(_vm.data).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant