tab2.page.ts 641 B

12345678910111213141516171819202122232425
  1. import { Component } from '@angular/core';
  2. import { Router } from '@angular/router';
  3. @Component({
  4. selector: 'app-tab2',
  5. templateUrl: 'tab2.page.html',
  6. styleUrls: ['tab2.page.scss']
  7. })
  8. export class Tab2Page {
  9. constructor(private router: Router) {}
  10. goToGame() {
  11. this.router.navigate(['/game']); // 导航到游戏页面,假设游戏页面路由为 '/game'
  12. }
  13. watchVideo() {
  14. window.open('https://www.douyin.com/?recommend=1', '_blank'); // 在新标签页中打开指定网站
  15. }
  16. goToFriend() {
  17. this.router.navigate(['/friend']); // 导航到知己页面,假设知己页面路由为 '/friend'
  18. }
  19. }