export const buttonClick = ( e , refArray , index ) => { const { current } = refArray [ index ] ; let _this = current ; if ( ! ! refArray [ index ] ) { switch ( refArray [ index ] . current . id ) { case 'button1' : console . log ( 'button1 클릭' ) ; _this . style . color = 'red' ; break ; case 'button2' : console . log ( 'button2 클릭' ) ; _this . style . color = 'purple' ; break ; case 'button3' : console . log ( 'butotn3 클릭' ) ; _this . style . color = 'skyblue' ; break ; case 'button4' : console . log ( 'button4 클릭' ) ; _this . style . color = 'blue' ; break ; default : console . log ( '정의 안되어있음' ) ; } } } ; export const linkClick = ( e , refArray , index ) => { e . preventDefault ( ) ; const { current } = refArray [ index ] as { current : HTMLAnchorElement ; } ; let _this = current ; if ( ! ! current ) { switch ( current . id ) { case 'home' : _this . style . color = 'red' ; break ; case 'introduce' : _this . style . color = 'purple' ; break ; case 'portfolio' : _this . style . color = 'skyblue' ; break ; case 'inquire' : _this . style . color = 'blue' ; break ; default : console . log ( '정의 안되어있다.' ) ; } } console . log ( 'a태그 클릭' , e . target . id ) ; } ;