欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

微信小程序按鈕巧妙用法

 更新時(shí)間:2022年12月15日 10:42:21   作者:熱愛(ài)編程的小白白  
這篇文章主要介紹了微信小程序按鈕巧妙用法,按鈕組件功能比?HTML?中的?button?按鈕豐富,通過(guò)?open-type?屬性可以調(diào)用微信提供的各種功能(客服、轉(zhuǎn)發(fā)、獲取用戶授權(quán)、獲取用戶信息等),需要的朋友可以參考下

??button 按鈕的基本使用

按鈕組件

功能比 HTML 中的 button 按鈕豐富

通過(guò) open-type 屬性可以調(diào)用微信提供的各種功能(客服、轉(zhuǎn)發(fā)、獲取用戶授權(quán)、獲取用戶信息等)

通過(guò)type屬性指定按鈕顏色類型

WXML:

<!-- 通過(guò)type屬性指定按鈕顏色類型 -->
<button>普通按鈕</button>
<button type="primary">主色調(diào)</button>
<button type=warn">警告</button>

注:后期會(huì)對(duì)按鈕添加事件,現(xiàn)在只是給大家演示一下按鈕的類型

小尺寸按鈕

<button size="mini">普通按鈕</button>
<button type="primary" size="mini">主色調(diào)</button>
<button type=warn" size="mini">警告</button>

plain鏤空按鈕 

<button plain>普通按鈕</button>
<button type="primary" plain>主色調(diào)</button>
<button type=warn" plain>警告</button>

??各種神奇的按鈕

去這里找按鈕的樣式,然后復(fù)制:

Buttons - copy CSS & HTML! (uiverse.io)

 WXML:(大家到時(shí)候需要改一改,因?yàn)槲抑苯訌?fù)制上面 按鈕樣式 里面的代碼)

<button>
  <span>Button</span>
  <view class="liquid"></view>
</button>

WXSS:

/* From www.lingdaima.com */
button {
  position: relative;
  padding: 19px 36px;
  display: block;
  text-decoration: none;
  text-transform: uppercase;
  overflow: hidden;
  border-radius: 40px;
  border: none;
 }
 
 button span {
  position: relative;
  color: #fff;
  font-family: Arial;
  letter-spacing: 8px;
  z-index: 1;
 }
 
 button .liquid {
  position: absolute;
  top: -80px;
  left: 0;
  width: 100%;
  height: 200px;
  background: #4973ff;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, .5);
  transition: .5s;
 }
 
 button .liquid::after,
 button .liquid::before {
  content: '';
  width: 200%;
  height: 200%;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -75%);
  background: #fff;
 }
 
 button .liquid::before {
  border-radius: 45%;
  background: rgba(20, 20, 20, 1);
  animation: animate 5s linear infinite;
 }
 
 button .liquid::after {
  border-radius: 40%;
  background: rgba(20, 20, 20, .5);
  animation: animate 10s linear infinite;
 }
 
 button:hover .liquid {
  top: -120px;
 }
 
 @keyframes animate {
  0% {
   transform: translate(-50%, -75%) rotate(0deg);
  }
 
  100% {
   transform: translate(-50%, -75%) rotate(360deg);
  }
 }

WXML:

<button> Button
</button>

WXSS:

/* From uiverse.io by @adamgiebl */
button {
  background: #FBCA1F;
  font-family: inherit;
  padding: 0.6em 1.3em;
  font-weight: 900;
  font-size: 18px;
  border: 3px solid black;
  border-radius: 0.4em;
  box-shadow: 0.1em 0.1em;
 }
 
 button:hover {
  transform: translate(-0.05em, -0.05em);
  box-shadow: 0.15em 0.15em;
 }
 
 button:active {
  transform: translate(0.05em, 0.05em);
  box-shadow: 0.05em 0.05em;
 }

下期預(yù)告:image 組件的基本使用

到此這篇關(guān)于微信小程序按鈕巧妙用法的文章就介紹到這了,更多相關(guān)微信小程序按鈕內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論