Vue.js 移动端 UI 组件库 YDUI

Vue-yduiYDUI Touch 的一个基于 Vue2.x 的移动端&微信UI实现版本,专为移动端打造,在追求完美视觉体验的同时也保证了其性能高效。

官网:http://www.ydui.org/
GitHub:https://github.com/ydcss/vue-ydui

安装

推荐使用 npm 来安装,享受生态圈和工具带来的便利,更好地和 webpack 配合使用:

1
npm install vue-ydui --save

集成

App.vue

1
2
3
@import "../node_modules/vue-ydui/dist/ydui.base.css";
/*@import "../node_modules/vue-ydui/dist/ydui.px.css";*/
@import "../node_modules/vue-ydui/dist/ydui.rem.css";

main.js

1
2
3
4
5
6
7
8
9
10
11
12
13
// import YDUI from 'vue-ydui/dist/ydui.px.js'
import YDUI from 'vue-ydui/dist/ydui.rem.js'
import { Confirm, Alert, Toast, Notify, Loading } from 'vue-ydui/dist/lib.px/dialog'

Vue.use(YDUI)

Vue.prototype.$dialog = {
confirm: Confirm,
alert: Alert,
toast: Toast,
notify: Notify,
loading: Loading
}

index.vue

1
2
3
4
5
6
7
8
9
10
11
12
13
14
methods: {
pay () {
var _this = this
this.$dialog.confirm({
title: '提示',
mes: '您尚未登录,是否前往登陆?',
cancel_mes: '取消',
ok_mes: '确认',
opts: () => {
_this.$router.push({path: '/login', query: {'mobile': _this.mobile}})
}
})
}
}

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :