最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

vue.js提交按鈕時(shí)進(jìn)行簡(jiǎn)單的if判斷表達(dá)式詳解

 更新時(shí)間:2018年08月08日 09:40:38   作者:祈澈菇?jīng)? 
這篇文章主要給大家介紹了關(guān)于vue.js提交按鈕時(shí)如何進(jìn)行簡(jiǎn)單的if判斷表達(dá)式的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧

前言

本文主要介紹的是vue.js提交按鈕時(shí)進(jìn)行簡(jiǎn)單的if判斷表達(dá)式的相關(guān)內(nèi)容,分享出來供大家參考學(xué)習(xí),是一個(gè)簡(jiǎn)單的業(yè)務(wù)需求,下面話不多說了,看圖說話

1:當(dāng)充值金額沒有填寫的時(shí)候,會(huì)有Toast小彈框提示“請(qǐng)輸入有效的充值金額”


if (!this.money)
    {
     console.log('money',money);
     Toast({
      message: '請(qǐng)輸入有效的充值金額',
      duration: 2000
     });
    }

2:當(dāng)?shù)诙€(gè)框?qū)嵤战痤~沒有填寫的時(shí)候,會(huì)有Toast小彈框提示“請(qǐng)輸入有效的實(shí)付金額”


 else if (!this.moneyReal)
    {
     console.log('moneyReal',moneyReal);
     Toast({
      message: '請(qǐng)輸入有效的實(shí)付金額',
      duration: 2000
     });
    }

3:當(dāng)兩個(gè)輸入框都填寫的時(shí)候,會(huì)彈出一個(gè)MessageBox詢問框


else
    {
     MessageBox.confirm('你確定要充值么?', '提示').then(action => {
     });
    }

具體demo如下

<template>
 <div class="app">

  <mt-field label="充值金額" id="money" placeholder="請(qǐng)輸入" v-model="money" type="number"></mt-field>
  <mt-field label="實(shí)收金額" id="moneyReal" placeholder="請(qǐng)輸入" v-model="moneyReal" type="number"></mt-field>
  <div class="rechage">
   <button @click="chongZhiForMember">充 值</button>
  </div>
 </div>
</template>

<script>
 import { Field, MessageBox, Toast } from 'mint-ui';
 export default {
  data() {
   return {

    // 會(huì)員卡余額
   }
  },
  methods: {

   chongZhiForMember() {
    if(!this.money) {
     console.log('money', money);
     Toast({
      message: '請(qǐng)輸入有效的充值金額',
      duration: 2000
     });
    } else if(!this.moneyReal) {
     console.log('moneyReal', moneyReal);
     Toast({
      message: '請(qǐng)輸入有效的實(shí)付金額',
      duration: 2000
     });
    } else {
     MessageBox.confirm('你確定要充值么?', '提示').then(action => {

     });
    }
   }
  },

 }
</script>
<style scoped>
 .app {
  background: #F1F1F1;
  height: 17.78rem;
 }
 
 .rechage button {
  outline: none;
  border: none;
  height: 1rem;
  width: 3.5rem;
  font-size: 0.5rem;
  color: white;
  background: #449EF4;
  border-radius: 0.15rem;
 }
 
 .rechage {
  text-align: center;
  margin-top: 1rem
 }
</style>

總結(jié)

以上就是這篇文章的全部?jī)?nèi)容了,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,如果有疑問大家可以留言交流,謝謝大家對(duì)腳本之家的支持。

相關(guān)文章

最新評(píng)論

建湖县| 抚顺市| 平度市| 神池县| 长白| 龙门县| 林口县| 榆社县| 无锡市| 交口县| 嵊泗县| 东莞市| 沅陵县| 沙田区| 阿瓦提县| 吉安县| 资溪县| 文安县| 沁水县| 北辰区| 马关县| 沙洋县| 刚察县| 北碚区| 延津县| 屏山县| 临沭县| 华坪县| 尉犁县| 波密县| 怀仁县| 自贡市| 荥经县| 江油市| 天镇县| 托里县| 元氏县| 上饶县| 车致| 恩平市| 柳州市|