gpt4 book ai didi

javascript - Ionic ionic View 标题未显示

转载 作者:行者123 更新时间:2023-11-28 06:16:58 25 4
gpt4 key购买 nike

我对 Ionic 比较陌生,我正在尝试制作一个简单的登录页面。但是,当我放置它时,它不会显示标题栏。有谁知道我做错了什么?

<ion-view view-title="Sign-In">
<ion-content>
<div class="list">
<label class="item item-input">
<span class="input-label">Username</span>
<input type="text" ng-model="user.username">
</label>
<label class="item item-input">
<span class="input-label">Password</span>
<input type="password" ng-model="user.password">
</label>
</div>
<div class="padding">
<button class="button button-block button-positive" ng- click="signIn(user)">
Sign-In
</button>
<p class="text-center">
<a href="#/forgot-password">Forgot password</a>
</p>
</div>
</ion-content>
</ion-view>

最佳答案

您还没有为页眉编写 html。您需要添加一个带有 class="bar bar-header" 的 div 以显示标题。

  <ion-view view-title="Sign-In">
<div class="bar bar-header bar-light">
<h1 class="title">Header</h1>
</div>
<ion-content class="has-header">
<div class="list">
<label class="item item-input">
<span class="input-label">Username</span>
<input type="text" ng-model="user.username">
</label>
<label class="item item-input">
<span class="input-label">Password</span>
<input type="password" ng-model="user.password">
</label>
</div>
<div class="padding">
<button class="button button-block button-positive" ng-click="signIn(user)">
Sign-In
</button>
<p class="text-center">
<a href="#/forgot-password">Forgot password</a>
</p>
</div>
</ion-content>
</ion-view>

这是一个有效的 fiddle .

关于javascript - Ionic ionic View 标题未显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35840093/

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