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