我试图在此页面上使用的离子后退按钮拒绝出现。当我应该出现“ selected_card.page.html selected_card.page.ts 让我知道大家是否有疑问!真的无法弄清楚为什么我每次使用它时都无法正常工作。 <ion-toolbar>
<ion-buttons slot='start'>
<ion-back-button></ion-back-button>
</ion-buttons>
<ion-title>{{restaurant.name}}</ion-title>
</ion-toolbar>
</ion-header>
import { ModalController, NavParams } from '@ionic/angular';
import { RestaurantsService } from '../services/restaurants.service';
@Component({
selector: 'app-selected-card',
templateUrl: './selected-card.page.html',
styleUrls: ['./selected-card.page.scss'],
})
export class SelectedCardPage implements OnInit {
// value: string;
restaurant: any;
constructor(private restaurantsService: RestaurantsService,
private modalCtrl: ModalController,
private navParams: NavParams) { }
ngOnInit() {
this.restaurant = this.navParams.get('restaurant');
console.log(this.restaurant);
}
selectRestaurant() {
console.log(this.customRestaurant)
this.customRestaurant()
}
dismiss() {
this.modalCtrl.dismiss();
}
}
答案 0 :(得分:0)
我不清楚您的问题,但如果您想使用 ion-back-button ,则不会在 ion-buttons 中使用此组件。应该使用 ion-back-button 代替 ion-button ...
<ion-toolbar>
<ion-buttons slot='start'>
<ion-back-button></ion-back-button>
</ion-buttons>
<ion-title>{{restaurant.name}}</ion-title>
</ion-toolbar>
</ion-header>
答案 1 :(得分:0)
这应该用于显示后退按钮。
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-back-button></ion-back-button>
</ion-buttons>
<ion-title>
Room info page
</ion-title>
</ion-toolbar>
</ion-header>