做网站用ui好还是ps,wordpress welcome,工商注册图片,临安区建设局网站Mint-ui
简介 基于 Vue.js 的移动端组件库 Mint UI 包含丰富的 CSS 和 JS 组件#xff0c;能够满足日常的移动端开发需要。通过它#xff0c;可以快速构建出风格统一的页面#xff0c;提升开发效率。 真正意义上的按需加载组件。可以只加载声明过的组件及其样式文件…Mint-ui
简介 基于 Vue.js 的移动端组件库 Mint UI 包含丰富的 CSS 和 JS 组件能够满足日常的移动端开发需要。通过它可以快速构建出风格统一的页面提升开发效率。 真正意义上的按需加载组件。可以只加载声明过的组件及其样式文件无需再纠结文件体积过大。 考虑到移动端的性能门槛Mint UI 采用 CSS3 处理各种动效避免浏览器进行不必要的重绘和重排从而使用户获得流畅顺滑的体验。 依托 Vue.js 高效的组件化方案Mint UI 做到了轻量化。即使全部引入压缩后的文件体积也仅有 ~30kb (JS CSS) gzip。 安装及引入
cnpm install mint-ui --save-dev引入
按需引入,在页面中引入所使用到的插件
// 按需引入部分组件
import { Cell, Checklist } from mint-ui;全部引入 全部引入无效还是要在页面中引入所用的插件所以都使用按需引入 import Vue from vue;
import Mint from mint-ui;
Vue.use(Mint);在main.js中导入css样式
import mint-ui/lib/style.css示例
messagebox示例
在app.vue项目中引入
import {MessageBox} from mint-ui直接使用组件点击触发的事件添加到methods中完整代码
templatediv idappbutton clickalert打开confirm弹框/button/div
/templatescript
import {MessageBox} from mint-ui
export default {name: app,data() {return {};},methods: {alert() {MessageBox({title: 提示,message: 确定执行此操作?,showCancelButton: true});}}
};
/script图片轮播
引入需要的组件
import { Swipe, SwipeItem} from mint-ui;如果想直接使用组件在component中声明用到的组件名称为模板默认也可以自己自定义 components: {father: Swipe,//引号中可以自己改名mt-swipe-item: SwipeItem}画完页面后没有显示根据样式高度是父元素100%等将组件用div包起来后给div设置高度并给组件设置背景色 div styleheight:100pxfather :auto4000mt-swipe-itemdiv classcommon1/div/mt-swipe-itemmt-swipe-itemdiv classcommon2/div/mt-swipe-itemmt-swipe-itemdiv classcommon3/div/mt-swipe-item/father/divstyle
.common{height: 100px;background: rgb(22, 196, 129);text-align: center;
}
/style从官网中也能查到组件的一些其他api,按需使用
时间选择
引入需要组件
import { DatetimePicker } from mint-ui;通过页面中的一个按钮触发 button clickopentimeopen time/button添加组件组件中已经写好了按下确认键的事件名称confirm divmt-datetime-pickerrefpickertypedateyear-format{value} 年month-format{value} 月date-format{value} 日v-modelpickerValueconfirmhandleConfirm/mt-datetime-picker/div将相关函数添加到方法methods中
opentime() {this.$refs.picker.open();},handleConfirm() {console.log(this.pickerValue);}Element-ui
简介 PC端组件库学习网站 https://element.eleme.cn/#/zh-CN/component/icon 安装
install可以简写为i cnpm i element-ui --save-dev导入css库 import element-ui/lib/theme-chalk/index.css 因为没有相关的解析字体文件所以会疯狂报错 解决 查看package.json中有没有url-loader,如果没有则需要安装cnpm install url-loader --save-dev安装成功后在webpack.config.js的rules中配置相关的解析文件 { test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, loader: url-loader }装完后不会报错 待解决bug使用时图标无法加载显示 百度后发现说查看package中element-ui的版本和官网https://element.eleme.cn/#/zh-CN/component/icon 版本是否相同查看后没有问题但还是无法正常显示
引入 推荐使用全局引入 在main.js中引入 import ElementUI from element-ui;Vue.use(ElementUI);
import element-ui/lib/theme-chalk/index.css之后直接摘抄官网中组件的用法即可
示例
DatePicker 日期选择器 直接将官网中的内容复制到页面中组件已经全局引入的前提下
templatediv idappdiv classblockspan classdemonstration默认/spanel-date-picker v-modelvalue1 typedate placeholder选择日期/el-date-picker/divdiv classblockspan classdemonstration带快捷选项/spanel-date-pickerv-modelvalue2alignrighttypedateplaceholder选择日期:picker-optionspickerOptions1/el-date-picker/div/div
/templatescript
export default {name: app,data() {return {pickerOptions1: {disabledDate(time) {return time.getTime() Date.now();},shortcuts: [{text: 今天,onClick(picker) {picker.$emit(pick, new Date());}},{text: 昨天,onClick(picker) {const date new Date();date.setTime(date.getTime() - 3600 * 1000 * 24);picker.$emit(pick, date);}},{text: 一周前,onClick(picker) {const date new Date();date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);picker.$emit(pick, date);}}]},value1: ,value2: };},components: {},methods: {}
};
/script
style
/style实现效果
messagebox弹框
templatediv idappel-button typetext clickopen点击打开 Message Box/el-button/div
/templatescript
export default {name: app,data() {return {};},components: {},methods: {open() {this.$confirm(此操作将永久删除该文件, 是否继续?, 提示, {confirmButtonText: 确定,cancelButtonText: 取消,type: warning}).then(() {this.$message({type: success,message: 删除成功!});}).catch(() {this.$message({type: info,message: 已取消删除}); });}}
};
/script
style
/style