gpt4 book ai didi

ionic-framework - ng-click 内部标签不起作用

转载 作者:行者123 更新时间:2023-12-03 23:37:06 25 4
gpt4 key购买 nike

<ion-view>
<div class="bar bar-header bar-dark">
<h1 class="title">Welcome</h1>
</div>
<ion-content class="has-header">
<form ng-submit="doLogin()">
<div class="list">
<label class="item item-input">
<span class="input-label">手机号</span>
<input type="text" ng-model="phonenumber" placeholder="这里输入手机号" maxlength="11">
<button class="button button-dark" style="margin-right: 16px;" ng-click="getVerifyCode(111)">获取验证码</button>
</label>
<label class="item item-input">
<span class="input-label">验证码</span>
<input type="password" ng-model="verifycode">
</label>
<label class="item">
<button class="button button-block button-dark" ng-click="getVerifyCode(111)">登 陆</button>
</label>
</div>
</form>
</ion-content>
</ion-view>


  • 为什么标签标签里面的按钮(获取验证码)不起作用?
  • 但是标签标签外面的按钮(登陆)工作正常,为什么?
  • 请帮我解决这个问题。我需要在点击时做出回应
    按钮(获取验证码)
  • 最佳答案

    working demo

    解决方案就是不使用 label为项目。相反,只需使用 div
    html

    <form ng-submit="doLogin()">
    <div class="list">
    <div class="item item-input">
    <span class="input-label">手机号</span>
    <input type="text" ng-model="phonenumber" placeholder="这里输入手机号" maxlength="11">
    <!-- <input ></input> -->
    <button class="button button-dark" style="margin-right: 16px;" ng-click="getVerifyCode(111)">获取验证码</button>
    </div>
    <label class="item item-input">
    <span class="input-label">验证码</span>
    <input type="password" ng-model="verifycode">
    </label>
    <label class="item">
    <button class="button button-block button-dark" ng-click="getVerifyCode(111)">登 陆</button>
    </label>
    </div>
    </form>

    关于ionic-framework - ng-click 内部标签不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33686810/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com