cube-ui运行报错

使用cube-ui报错如下

Can't resolve './cubeic.ttf' in '/node_modules/cube-ui/src/common/stylus'

client?5e6b:161 [WDS] Errors while compiling. Reload prevented.
errors @ client?5e6b:161
onmessage @ socket.js?57b2:41
EventTarget.dispatchEvent @ sockjs.js?3600:170
(anonymous) @ sockjs.js?3600:883
SockJS._transportMessage @ sockjs.js?3600:881
EventEmitter.emit @ sockjs.js?3600:86
WebSocketTransport.ws.onmessage @ sockjs.js?3600:2957
client?5e6b:167 ./node_modules/css-loader?{"sourceMap":true}!./node_modules/postcss-loader/lib?{"sourceMap":true}!./node_modules/stylus-loader?{"sourceMap":true}!./node_modules/cube-ui/src/common/stylus/index.styl
Module not found: Error: Can't resolve './cubeic.ttf' in '/Users/nali/project/hybrid-sound-city/node_modules/cube-ui/src/common/stylus'
 @ ./node_modules/css-loader?{"sourceMap":true}!./node_modules/postcss-loader/lib?{"sourceMap":true}!./node_modules/stylus-loader?{"sourceMap":true}!./node_modules/cube-ui/src/common/stylus/index.styl 7:4444-4467
 @ ./node_modules/cube-ui/src/common/stylus/index.styl
 @ ./node_modules/cube-ui/src/modules/style/index.js
 @ ./node_modules/cube-ui/src/module.js
 @ ./node_modules/cube-ui/src/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://192.168.72.51:8080 webpack/hot/dev-server ./src/main.js
errors @ client?5e6b:167
onmessage @ socket.js?57b2:41
EventTarget.dispatchEvent @ sockjs.js?3600:170
(anonymous) @ sockjs.js?3600:883
SockJS._transportMessage @ sockjs.js?3600:881
EventEmitter.emit @ sockjs.js?3600:86
WebSocketTransport.ws.onmessage @ sockjs.js?3600:2957
client?5e6b:167 ./node_modules/css-loader?{"sourceMap":true}!./node_modules/postcss-loader/lib?{"sourceMap":true}!./node_modules/stylus-loader?{"sourceMap":true}!./node_modules/cube-ui/src/common/stylus/index.styl
Module not found: Error: Can't resolve './cubeic.woff' in '/Users/nali/project/hybrid-sound-city/node_modules/cube-ui/src/common/stylus'
 @ ./node_modules/css-loader?{"sourceMap":true}!./node_modules/postcss-loader/lib?{"sourceMap":true}!./node_modules/stylus-loader?{"sourceMap":true}!./node_modules/cube-ui/src/common/stylus/index.styl 7:4380-4404
 @ ./node_modules/cube-ui/src/common/stylus/index.styl
 @ ./node_modules/cube-ui/src/modules/style/index.js
 @ ./node_modules/cube-ui/src/module.js
 @ ./node_modules/cube-ui/src/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://192.168.72.51:8080 webpack/hot/dev-server ./src/main.js
errors @ client?5e6b:167
onmessage @ socket.js?57b2:41
EventTarget.dispatchEvent @ sockjs.js?3600:170
(anonymous) @ sockjs.js?3600:883
SockJS._transportMessage @ sockjs.js?3600:881
EventEmitter.emit @ sockjs.js?3600:86
WebSocketTransport.ws.onmessage @ sockjs.js?3600:2957
client?5e6b:167 ./node_modules/cube-ui/src/common/helpers/parse-render-data.js
Module parse failed: Unexpected token (5:18)
You may need an appropriate loader to handle this file type.
| export default function parseRenderData(data = {}, events = {}) {
|   events = parseEvents(events)
|   const props = { ...data }
|   const on = {}
|   for (const name in events) {
 @ ./node_modules/cube-ui/src/common/helpers/create-api-component.js 2:0-49
 @ ./node_modules/cube-ui/src/common/helpers/create-api.js
 @ ./node_modules/cube-ui/src/modules/create-api/index.js
 @ ./node_modules/cube-ui/src/module.js
 @ ./node_modules/cube-ui/src/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://192.168.72.51:8080 webpack/hot/dev-server ./src/main.js
阅读 11.9k
3 个回答

安装cube-ui之后还要配置一下相关文件才能使用

新手上路,请多包涵

你好,我按照官方文档按需引入 采用后编译模式
// import {Style, Toast, DatePicker, Dialog, Picker, createAPI} from 'cube-ui'
Vue.use(DatePicker)
"export 'DatePicker' was not found in 'cube-ui'
全局引入可以正常使用

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题