【问题标题】:VueJS + AT UIKIT: Failed to compileVueJS + AT UIKIT:编译失败
【发布时间】:2017-11-16 19:22:56
【问题描述】:

我使用vue init webpack-simple 搭建了一个项目。我希望使用AT-UIKIT 组件库,但我遇到了来自 webpack 的以下编译错误:

Failed to compile.

./node_modules/at-ui-style/css/fonts/feather.ttf?t=1501829003743
Module parse failed: Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
 @ ./node_modules/css-loader!./node_modules/at-ui-style/css/at.css 6:71718-71764
 @ ./node_modules/at-ui-style/css/at.css
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js

这是我的 main.js:

import Vue from 'vue'
import App from './App.vue'

import AtComponents from 'at-ui'
import 'at-ui-style'    // Import CSS

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

我是 VueJS 和 webpack 的新手。我要安装某个加载程序来解决这个问题吗?感谢您的帮助。

【问题讨论】:

标签: webpack vue.js vuejs2


【解决方案1】:

你忘了install插件。

在你的 main.js 中添加代码:

Vue.use(AtComponents)

【讨论】:

    猜你喜欢
    • 2018-11-06
    • 2021-12-28
    • 2020-07-25
    • 2021-12-26
    • 2021-10-07
    • 2021-06-14
    • 2021-01-29
    • 1970-01-01
    • 2013-02-01
    相关资源
    最近更新 更多