Element: Can't get example run

Created on 1 Mar 2017  ·  5Comments  ·  Source: ElemeFE/element

import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-default/index.css'
import App from './App.vue'

Vue.use(ElementUI)

new Vue({
  el: '#app',
  render: h => h(App)
})

error:

Uncaught TypeError: Cannot read property 'prototype' of undefined
    at Object.e.__esModule.default (index.js:2)
    at t (index.js:1)
    at Object.e.__esModule.default (index.js:2)
    at t (index.js:1)
    at Object.e.__esModule.default (index.js:2)
    at t (index.js:1)
    at Object.e.__esModule.default (index.js:2)
    at t (index.js:1)
    at Object.e.__esModule.default (index.js:2)
    at t (index.js:1)
"dependencies": {
    "element-ui": "^1.2.3",
    "vue": "^2.1.10"
  }
repro

Most helpful comment

I had the same problem. After I removed the <script src="https://unpkg.com/element-ui/lib/index.js"></script> in the index.html, the error is gone. Hope that helps.

All 5 comments

I had the same problem. After I removed the <script src="https://unpkg.com/element-ui/lib/index.js"></script> in the index.html, the error is gone. Hope that helps.

Hi! I had the same problem, how to fix this?

To fix this issue just import your javascript file for element UI after importing VueJS

But in the index file there is no inclusion of the VueJs





so if you put <script src="https://unpkg.com/element-ui/lib/index.js"></script> after 'built files will be auto injected' you will get the error. So i don't know how to solve this.

Was this page helpful?
0 / 5 - 0 ratings