1.3.7
windows7/google chrome 59.0.3071.115(正式版本) (32 位)
2.3.4
页面中引入index.js,其他什么都不需要做,就会报错
不报错
报错:Uncaught TypeError: Cannot read property 'prototype' of undefined
Translation of this issue:
1.3.7
Windows7/google chrome 59.0.3071.115 (official version) (32 bits)
2.3.4
Index.js is introduced into the page, and nothing else needs to be done
Error free
Error: Uncaught, TypeError:, Cannot, read, property,'prototype', of, undefined
找到原因了,自己的问题
什么原因,我也遇到类似的问题,vue-cli新建的项目刚引入element报错:
index.js:2 Uncaught TypeError: Cannot read property 'prototype' of undefined
at Object.t.__esModule (index.js:2)
at t (index.js:1)
at Object.t.__esModule (index.js:2)
at t (index.js:1)
at Object.t.__esModule (index.js:2)
at t (index.js:1)
at Object.t.__esModule (index.js:2)
at t (index.js:1)
at Object.t.__esModule (index.js:2)
at t (index.js:1)
I have the same issue.
Vue 2.8.2
Element-ui 1.4.3
Uncaught TypeError: Cannot read property 'prototype' of undefined
at Object.t.__esModule (index.js:2)
at t (index.js:1)
at Object.t.__esModule (index.js:2)
at t (index.js:1)
at Object.t.__esModule (index.js:2)
at t (index.js:1)
at Object.t.__esModule (index.js:2)
at t (index.js:1)
at Object.t.__esModule (index.js:2)
at t (index.js:1)
property 'prototype' of undefined 为啥黎?
卧槽 ,什么原因 ,说一下啊大哥 。 我在vue中的 index.html刚刚引入 就报错
@dinghao1994 看看是不是引入的vue版本不对
版本是 2.9.3 应该不是版本问题吧
不是版本问题,应该是引入顺序错了,把vue.js引用放在index.js前面就好了
vuejs的文件引入需要在element-ui的index.js文件前面
正如 @JesseJia 和 @gdmec07140726 说的,引入顺序问题。我是 rails 写了嵌套模版,里层引入 element-ui,外层引入 vue,但是渲染顺序写反了
<head>
<%= stylesheet_link_tag 'v2/element-ui', media: 'all' %>
<%= javascript_include_tag 'v2/element-ui' %>
</head>
<%= render template: "layouts/v2/application" %> <%#引入 vue%>
顺序调整一下就好了
<%= render template: "layouts/v2/application" %> <%#引入 vue%>
<head>
<%= stylesheet_link_tag 'v2/element-ui', media: 'all' %>
<%= javascript_include_tag 'v2/element-ui' %>
</head>
Most helpful comment
不是版本问题,应该是引入顺序错了,把vue.js引用放在index.js前面就好了