vue配置mint-ui找不到css

ERROR Failed to compile with 1 errors 16:13:56

This dependency was not found:

* mint-ui/lib/style.css in ./src/main.js

To install it, you can run: npm install --save mint-ui/lib/style.css

最后换了mini ui 上面的 脚手架就没问题了。

但是后面还会有三个警告

npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

第一个警告处理

npm install ajv@^6.0.0  

就OK

第二个第三个警告是苹果的不用管。

使用 vue-cli

npm install -g vue-cli

vue init webpack projectname

引入 Mint UI

你可以引入整个 Mint UI,或是根据需要仅引入部分组件。我们先介绍如何引入完整的 Mint UI。

完整引入

在 main.js 中写入以下内容:

import Vue from 'vue'
import MintUI from 'mint-ui' import 'mint-ui/lib/style.css' import App from './App.vue' Vue.use(MintUI) new Vue({ el: '#app', components: { App } }) 

以上代码便完成了 Mint UI 的引入。需要注意的是,样式文件需要单独引入。

以上完成就OK

猜你喜欢

转载自www.cnblogs.com/hasubasora/p/9415458.html