wenpack-simple+elementUI配置 – 房东家的猫

首先跟着element官方文档走一遍

注意把.babelrc改成这样

{
  "presets": [
    ["env", { "modules": false }],
    "stage-3"
  ],
  "plugins": [["component", {
    "libraryName": "element-ui",
    "styleLibraryName": "theme-chalk"
  }
  ]]
}

在webpack.config.js

{
        test: /.(woff2?|eot|ttf|otf)(?.*)?$/,
        loader: 'url-loader',
        options: {
            limit: 10000,
            name: '[name].[ext]'
        }
    }

安装style-loader依赖npm install --save-dev style-loader

再安装url-loadernpm install --save-dev url-loader

如果安装less ,less-loader

cnpm install less less-loader -D

cnpm install node-sass sass-loader -D

<style lang="sass" scoped> .....</style>

引用日历组件

在src文件夹中新建components文件夹->Date.vue复制内容注意template内记得用div包着

在App.vue 中script标签中import Date from "./components/Date.vue"``components:{Date}

在template插入<Date></Date>标签

bower包管理器

下包: bower install 包名

简写i -->install D-->--save-dev S -->--save

例如bootstrap

bower install bootstrap

然后再index.html直接引用就可以了

啰嗦几句改端口

在package.json中在--hot --port 8800



You must enable javascript to see captcha here!

Copyright © All Rights Reserved · Green Hope Theme by Sivan & schiy · Proudly powered by WordPress

无觅相关文章插件,快速提升流量