angular简易switch选择按钮

本文将指导您通过三个步骤在Angular应用中创建一个简单的Switch选择按钮。首先,您将在'app.component.ts'文件中进行配置;其次,在'app.component.html'中定义视图;最后,在'app.component.css'中设置样式完成交互设计。
摘要由CSDN通过智能技术生成

angular简易switch选择按钮

step1: D:\vue\untitled2905\src\app\app.component.ts

import {
    Component } from '@angular/core';

@Component({
   
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
   
  title = 'untitled2905';
  name = false;
  viewName = '关闭';
  getData(){
   
    if (this.name){
   
      console.log('关闭');
      this.name = false;
      this.viewName = '关闭';
    }else{
   
      console
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值