随笔分类 - 前端歌谣-react18
前端-react18
摘要:import React from "react" import classNames from 'classnames' type MenuMode = 'horizontal' | 'vertical' export interface MenuProps { /**默认 active 的菜单项
阅读全文
摘要:import React from "react"; import classNames from "classnames" export enum ButtonSize{ Large='lg', Small='sm' } export enum ButtonType{ Primary="prima
阅读全文
摘要:classnames可以接受很多参数 报告
阅读全文
摘要:import React from "react" import classNames from 'classnames' export interface MenuItemProps { index?: string; disabled?: boolean; className?: string;
阅读全文
摘要:.btn { position: relative; display: inline-block; font-weight: $btn-font-weight; line-height: $btn-line-height; color: $body-color; white-space: nowra
阅读全文
摘要:import React from "react"; import classNames from "classnames" export enum ButtonSize{ Large='lg', Small='sm' } export enum ButtonType{ Primary="prima
阅读全文
摘要:import React, { useState } from "react"; interface IHelloProps { message?: string; } const LikeButton:React.FC = () => { const [like, setLike] = useSt
阅读全文
摘要:import React from "react"; interface IHelloProps{ message?:string; } const Hello:React.FunctionComponent<IHelloProps>=(props)=>{ return <h2>{props.mes
阅读全文
摘要:import React from "react"; interface IHelloProps{ message?:string; } const Hello:React.FunctionComponent<IHelloProps>=(props)=>{ return <h2>{props.mes
阅读全文
摘要:import React, { useEffect, useState } from "react"; interface IHelloProps { message?: string; } const MouseButton:React.FC = () => { const [like, setL
阅读全文
摘要:function echo(arg:any):any{ return arg } const result=echo(123) function echo<T>(arg:T):T{ return arg } const result1=echo(123) function swap<T,U>(tup
阅读全文
摘要:enum Direction{ Up="Up", Down="Down", Left="Left", Right="Right" } console.log(Direction.Up)//0 console.log(Direction[0])//Up // 常量枚举 可以提升性能 const val
阅读全文
摘要:interface Radio{ switchRadio():void } interface Battery{ checkBatteryStatus() } interface RadioWithBattery extends Radio{ } class Car implements Radio
阅读全文
摘要:class Animal{ protected name: string; static age=18 constructor (name:string){ this.name=name } run(){ return `${this.name}` } } const snake=new Anima
阅读全文