一 npm 方式

1,安装依赖 (已有项目)

如果想简单体验:基于vue-cli

/*

npm install vue -g

npm install vue-cli   -g   // -g 是否全局安装,如果不需要可不加

vue init webpack mint-pro

(一路回车默认即可)

*/

npm install -s mint-ui

2,main.js主函数配置

// 全局 mint-ui 引入
import Vue from 'vue'
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'

import router from './router'
import App from './App' Vue.use(MintUI);
Vue.config.productionTip = false /* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>'
})

3,使用 app.vue

<template>
<div id="app">
<h2> hello mint-ui </h2>
<button @click="handleToast">click me!</button>
<button @click="handleIndictor">click me!</button>
<router-view/>
</div>
</template> <script>
export default {
name: 'App',
methods: {
handleToast () {
this.$toast({
message: '提示',
position: 'middle',
duration: 5000
})
},
handleIndictor (){
this.$indicator.open({
text: 'loading',
spinnerType: 'snake'
});
setTimeout(() => {
this.$indicator.close()
},2000);
}
}
}
</script>

4,npm run dev 预览结果

1)toast

2) indicator

5, css 组件 直接把官方标签引入即可

<template>
<div class="hello">
<h3>css components</h3>
<mt-header title="标题过长会隐藏后面的内容啊哈哈哈哈">
<router-link to="/" slot="left">
<mt-button icon="back">返回</mt-button>
</router-link>
<mt-button icon="more" slot="right"></mt-button>
</mt-header> <h3>form components</h3>
<mt-switch v-model="value">开关</mt-switch> </div>
</template> <script>
export default {
name: 'HelloWorld',
data() {
return {
value: false
}
}
}
</script>

5.1 对应效果

vue 引入 mint-ui 简单使用的更多相关文章

  1. 新建一个基于vue.js+Mint UI的项目

    上篇文章里面讲到如何新建一个基于vue,js的项目(详细文章请戳用Vue创建一个新的项目). 该项目如果需要组件等都需要自己去写,今天就学习一下如何新建一个基于vue.js+Mint UI的项目,直接 ...

  2. 基于VUE.JS的移动端框架Mint UI

    Mint UI GitHub:github.com/ElemeFE/mint 项目主页:mint-ui.github.io/# Demo:elemefe.github.io/mint- 文档:mint ...

  3. vue mint ui 手册文档对于墙的恐惧

    http://www.cnblogs.com/smallteeth/p/6901610.html npm 安装 推荐使用 npm 的方式安装,它能更好地和 webpack 打包工具配合使用. npm ...

  4. vue mint ui 手册文档

    npm 安装 推荐使用 npm 的方式安装,它能更好地和 webpack 打包工具配合使用. npm i mint-ui -S CDN 目前可以通过 unpkg.com/mint-ui 获取到最新版本 ...

  5. vue mint UI

    vue 与mint  UI 结合开发手机app  html5页面 api  文档   http://mint-ui.github.io/#!/zh-cn

  6. Mint UI文档

    Mint UI文档:http://elemefe.github.io/mint-ui/#/ 一.Mint UI的安装和基本用法. 1.NPM :npm i mint-ui -S 建议使用npm进行安装 ...

  7. Vue移动组件库Mint UI的安装与使用

    一.什么是 Mint UI 1.Mint UI 包含丰富的 CSS 和 JS 组件,可以提升移动端开发效率 2.Mint UI 按需加载组件 3.Mint UI 轻量化 二.Mint UI 的安装 1 ...

  8. 基于Mint UI和MUI开发VUE项目一之环境搭建和首页的实现

    一:简介 Mint UI 包含丰富的 CSS 和 JS 组件,能够满足日常的移动端开发需要.通过它,可以快速构建出风格统一的页面,提升开发效率.真正意义上的按需加载组件.可以只加载声明过的组件及其样式 ...

  9. vue Cli 按需引入Element UI 和全局引用Element UI

    全局引用: 一.安装 Element UI npm i element-ui -S 二.在main.js 中引入 element UI import ElementUI from 'element-u ...

  10. 关于Vue的各个UI框架(elementUI、mint-ui、VUX)

    elementUI 官网:http://element.eleme.io/ 使用步骤: 1.安装完vue-cli后,再安装 element-ui 命令行:npm i element-ui -D 相当于 ...

随机推荐

  1. Raspberry U盘操作

    项目系统要求的对U盘分区,分出系统盘与用户盘.这就有了今天的这个总结了: 1.输入命令“fdisk -l”查看设备挂载的位置,因为这个在设备挂载的时候有可能会发生变化. 假设设备挂载到了 /dev/s ...

  2. C# mvc读取模板并修改上传到web

    C# mvc读取模板并修改上传到web 后台: public FileResult GetXls() { FileStream fs = new FileStream(System.Web.HttpC ...

  3. C#启动外部程序(进程)

    通过调用Process类可以启动系统内部(环境变量里的)或者指定位置的程序,例如: Process.Start("notepad");//启动记事本 Process.Start(& ...

  4. collectd的python插件(redis)

    https://blog.dbrgn.ch/2017/3/10/write-a-collectd-python-plugin/ redis_info.conf <LoadPlugin pytho ...

  5. leetcode-Restore IP Addresses-ZZ

    http://www.cnblogs.com/remlostime/archive/2012/11/14/2770072.html class Solution { private: vector&l ...

  6. ACM HDU 1755 -- A Number Puzzle

    A Number Puzzle Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  7. GitHub & Git 基础 (YouTube中文翻译版)

    GitHub & Git 基础系列视频 播放列表 由于视频资源在YouTube上,可能需要FQ:https://code.google.com/p/chromeplus/ 视频包括以下内容 1 ...

  8. Android(java)学习笔记207:Android下的属性动画(Property Animation)

    1. 属性动画(Property Animation)引入: 在手机上去实现一些动画效果算是件比较炫酷的事情,因此Android系统在一开始的时候就给我们提供了两种实现动画效果的方式,逐帧动画(fra ...

  9. SSD 单发多框检测

    其实现在用的最多的是faster rcnn,等下再弄项目~~~ 图像经过基础网络块,三个减半模块,每个减半模块由两个二维卷积层,加一个maxPool减半(通道数依次增加[16,32,64]) 然后是多 ...

  10. luogu P3941 入阵曲

    嘟嘟嘟 这道题我觉得跟最大子矩阵那道题非常像,都是O(n4)二维前缀和暴力很好想,O(n3)正解需要点转化. O(n4)暴力就不说啦,二维前缀和,枚举所有矩形,应该能得55分. O(n3)需要用到降维 ...