iview / iview-loader

Better to combine with webpack
MIT License
31 stars 20 forks source link

在JSX中的使用报错 #7

Open weihongyu12 opened 6 years ago

weihongyu12 commented 6 years ago

使用了官网的配置,在render函数中这样写

render: (h, params) => (
  <div>
    <i-button  type="info"> 查看</i-button>
  </div>
),

出现如下提示:

ReferenceError: Button is not defined
    at Object.render (eval at ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./node_modules/iview-loader/index.js?{"prefix":true}!./src/views/page/table-list.vue (10.9c8c75d4e48bdc98cd45.hot-update.js:7), <anonymous>:129:15)
    at render (iview.js?0536:5107)
    at createFunctionalComponent (vue.runtime.esm.js?ff9b:4006)
    at createComponent (vue.runtime.esm.js?ff9b:4178)
    at _createElement (vue.runtime.esm.js?ff9b:4359)
    at createElement (vue.runtime.esm.js?ff9b:4296)
    at vm._c (vue.runtime.esm.js?ff9b:4412)
    at Proxy.render (iview.js?0536:29651)
    at VueComponent.Vue._render (vue.runtime.esm.js?ff9b:4470)
    at VueComponent.updateComponent (vue.runtime.esm.js?ff9b:2761)
icarusion commented 6 years ago

暂时不支持在 Render 函数中使用。