跳至主要内容

博文

目前显示的是 六月, 2018的博文

js禁用emoji表情

参考链接 参考链接 let reg = /\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFF]/g let reg1 = /\%uD.{3}/g let emojiReg = reg1 if (emojiReg.test(escape(e.detail.value.phone))) { // 检测到表情 return false }

小程序内页自定义底导航

原文链接 pub样式(app.wxss) /*tabBar*/ .tab-bar { position: fixed; z-index: 99999; left:0; bottom:0; width: 100%; height: 88rpx; font-size: 19rpx; font-family: Arial, Helvetica, sans-serif; border-top:1px solid #ccc; color: #9b9b9b; background: #fff; text-align: center; } .tab-bar .menu-item { float:left; width: 33.3%; height: 100%; } .tab-bar .menu-item image { margin: 9rpx auto 1rpx auto; display: block; width: 55rpx; height: 55rpx; } .tab-bar .menu-item.active { color: #16d328; } .tab-bar .menu-item .active{ color:#16d328; } tabbar模板(pages/template/tabBar.wxml) <template name="tabBar"> <view class="tab-bar"> <block wx:for="{{tabBar.list}}" wx:key="pagePath"> <navigator url="{{item.pagePath}}" hover-class="none" open-type="reLaunch" class="menu-item"> <image src="{{item.selectedIconPath}}" wx:if=...

一劳永逸的搞定 flex 布局

原文链接 flex 基本概念 使用 flex 布局首先要设置父容器   display: flex ,然后再设置   justify-content: center 实现水平居中,最后设置   align-items: center 实现垂直居中。 #dad { display : flex; justify-content : center; align-items : center } 就是这么简单,大功告成。等等,好像哪里不对, justify-content 和   align-items 是啥?哪里可以看出横向、竖向的语义?是的,flex 的确没有那么简单,这就要从两个基本概念说起了。 说来也不难,flex 的核心的概念就是   容器 和   轴 。容器包括外层的   父容器 和内层的   子容器 ,轴包括   主轴 和   交叉轴 ,可以说 flex 布局的全部特性都构建在这两个概念上。flex 布局涉及到 12 个 CSS 属性(不含   display: flex ),其中父容器、子容器各 6 个。不过常用的属性只有 4 个,父容器、子容器各 2 个,我们就先从常用的说起吧。 1. 容器 容器具有这样的特点:父容器可以统一设置子容器的排列方式,子容器也可以单独设置自身的排列方式,如果两者同时设置,以子容器的设置为准。 1.1 父容器 设置子容器沿主轴排列: justify-content justify-content 属性用于定义如何沿着主轴方向排列子容器。 flex-start :起始端对齐 flex-end :末尾段对齐 center :居中对齐 space-around :子容器沿主轴均匀分布,位于首尾两端的子容器到父容器的距离是子容器间距的一半。 space-between :子容器沿主轴均匀分布,位于首尾两端的子容器与父容器相切。 设置子容器如何沿交叉轴排列: align-items align-items 属性用于定义如何沿着交叉轴方向分配子容器的间距。 flex-start :起始端对齐 ...

Installing Jenkins OS X Homebrew

原文链接 Homebrew is the easiest way to install and manage applications on OS X. Let\’s go through how we install and configure Jenkins. Installation Follow the instructions at  http://brew.sh/  if you have not had Homebrew installed. Then, let\’s proceed to install Jenkins $ brew update && brew install jenkins Jenkins is a Java web application. Download and install the latest  Java Runtime Environment  manually, or use  Homebrew Cask  to install it $ brew cask install java Starting Jenkins After Jenkins is installed successfully, follow the instructions to start Jenkins on login $ ln -sfv /usr/local/opt/jenkins/*.plist ~/Library/LaunchAgents If you want to configure Jenkins to launch on system startup, for all users on OS X, then copy the  plist  file to the system  Launchd  location instead $ sudo cp -fv /usr/local/opt/jenkins/*.plist /Library/LaunchDaemons $ sudo chown `whoami` /Library/LaunchDaemons/ho...