当前位置: 首页 > news >正文

网站的ip地址是什么汕头最好的seo外包

网站的ip地址是什么,汕头最好的seo外包,建网站前途,移动通网站建设做这个案例捏 因为需要用到样式,所以创建一个样式文件: //29_实战.module.css .active{text-decoration:line-through } 然后创建jsx文件,修改main文件:导入Todos,写入Todos组件 import { StrictMode } from react …

做这个案例捏

因为需要用到样式,所以创建一个样式文件:

//29_实战.module.css
.active{text-decoration:line-through
}

然后创建jsx文件,修改main文件:导入Todos,写入Todos组件

import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import Todos from './28_实战'createRoot(document.getElementById('root')).render(<StrictMode><Todos /></StrictMode>
)

Todos.jsx文件需要先写渲染组件的基本结构:

function Todos() {return (<div></div>)
}
export default Todos

观察案例,首先需要一个添加任务的文本框、点击添加任务的按钮、用value使用可控组件改变value值,记得加onChange:

return (<div><input type='text' value={msg} onChange={handleChange} /><button onClick={handleClick}>点击添加任务</button></div>)

改变value的值、使用Immer整合更改

 const [msg, setMsg] = useState('')const [list, setList] = useImmer([])const handleChange = (e) => {setMsg(e.target.value)}const handleClick = () => {setList((draft) => {draft.unshift({ id: list.length, task: msg, checked: false })})setMsg('')}

复选框功能:

 const unCompleteList = list.filter((item) => !item.checked)const completeList = list.filter((item) => item.checked)const handleChecked = (e, id) => {setList((draft) => {draft.find((item) => item.id === id).checked = e.target.checked //更改对应id的数据的复选框状态})}return(<div>{/* {未完成的列表} */}<CompleteListtitle={<h2>未完成的任务:{unCompleteList.length}个</h2>}handleChecked={handleChecked}list={unCompleteList}/>{/* {已完成的列表} */}<CompleteListtitle={<h2>已完成的任务:{completeList.length}个</h2>}list={completeList}handleChecked={handleChecked}/></div>)

列表的组件

function CompleteList({title = '',list = [],handleChecked = function () {},
}) {return (<>{title}<ul>{list.map((item) => {return (<likey={item.id}className={classNames({ [style.active]: item.checked })}><inputtype='checkbox'checked={item.checked}onChange={(e) => handleChecked(e, item.id)}/>{item.task}</li>)})}</ul></>)
}

整体的代码

import { func } from 'prop-types'
import { useState } from 'react'
import { useImmer } from 'use-immer'
import classNames from 'classnames'
import style from './29_实战.module.css'function CompleteList({title = '',list = [],handleChecked = function () {},
}) {return (<>{title}<ul>{list.map((item) => {return (<likey={item.id}className={classNames({ [style.active]: item.checked })}><inputtype='checkbox'checked={item.checked}onChange={(e) => handleChecked(e, item.id)}/>{item.task}</li>)})}</ul></>)
}function Todos() {const [msg, setMsg] = useState('')const [list, setList] = useImmer([])const unCompleteList = list.filter((item) => !item.checked)const completeList = list.filter((item) => item.checked)const handleChange = (e) => {setMsg(e.target.value)}const handleClick = () => {setList((draft) => {draft.unshift({ id: list.length, task: msg, checked: false })})setMsg('')}const handleChecked = (e, id) => {setList((draft) => {draft.find((item) => item.id === id).checked = e.target.checked //更改对应id的数据的复选框状态})}return (<div><input type='text' value={msg} onChange={handleChange} /><button onClick={handleClick}>点击添加任务</button>{/* {未完成的列表} */}<CompleteListtitle={<h2>未完成的任务:{unCompleteList.length}个</h2>}handleChecked={handleChecked}list={unCompleteList}/>{/* {已完成的列表} */}<CompleteListtitle={<h2>已完成的任务:{completeList.length}个</h2>}list={completeList}handleChecked={handleChecked}/></div>)
}
export default Todos

效果:


文章转载自:
http://dinncojaponica.ssfq.cn
http://dinncostrike.ssfq.cn
http://dinncocock.ssfq.cn
http://dinncolineament.ssfq.cn
http://dinncolandocrat.ssfq.cn
http://dinncodiphtherial.ssfq.cn
http://dinncoadornment.ssfq.cn
http://dinncoarillode.ssfq.cn
http://dinncoreindustrialization.ssfq.cn
http://dinncoindictable.ssfq.cn
http://dinncophotomixing.ssfq.cn
http://dinncogonimoblast.ssfq.cn
http://dinnconoisy.ssfq.cn
http://dinncopecuniosity.ssfq.cn
http://dinncopyrogallol.ssfq.cn
http://dinncoarrear.ssfq.cn
http://dinncoluxon.ssfq.cn
http://dinncooocyst.ssfq.cn
http://dinncocarryout.ssfq.cn
http://dinncoentrance.ssfq.cn
http://dinncoparesis.ssfq.cn
http://dinncokeffiyeh.ssfq.cn
http://dinncobaggy.ssfq.cn
http://dinncostrobic.ssfq.cn
http://dinncoinnocent.ssfq.cn
http://dinncopetulance.ssfq.cn
http://dinncoscupper.ssfq.cn
http://dinncosacrilegious.ssfq.cn
http://dinncoastrict.ssfq.cn
http://dinncoarchitectonic.ssfq.cn
http://dinncounderprop.ssfq.cn
http://dinncodingdong.ssfq.cn
http://dinncohybrid.ssfq.cn
http://dinncoawag.ssfq.cn
http://dinncoregistration.ssfq.cn
http://dinncoprophecy.ssfq.cn
http://dinncosophistic.ssfq.cn
http://dinncoremunerator.ssfq.cn
http://dinncoinelegance.ssfq.cn
http://dinncosolmisation.ssfq.cn
http://dinncoprompting.ssfq.cn
http://dinncosemiovoid.ssfq.cn
http://dinncoisolated.ssfq.cn
http://dinncokattegat.ssfq.cn
http://dinncohike.ssfq.cn
http://dinnconefariously.ssfq.cn
http://dinncogesamtkunstwerk.ssfq.cn
http://dinncomoa.ssfq.cn
http://dinncomoonlit.ssfq.cn
http://dinncosaltine.ssfq.cn
http://dinncocoral.ssfq.cn
http://dinncoatmometer.ssfq.cn
http://dinncounreaped.ssfq.cn
http://dinncosarcoidosis.ssfq.cn
http://dinncokooky.ssfq.cn
http://dinncobiogeocoenology.ssfq.cn
http://dinncocalefacient.ssfq.cn
http://dinncoturboshaft.ssfq.cn
http://dinncojuridic.ssfq.cn
http://dinncotraintime.ssfq.cn
http://dinncolandholding.ssfq.cn
http://dinncoibsenist.ssfq.cn
http://dinncoskinhead.ssfq.cn
http://dinncovelma.ssfq.cn
http://dinncogudrun.ssfq.cn
http://dinncoefflorescent.ssfq.cn
http://dinncohippomobile.ssfq.cn
http://dinncocerotype.ssfq.cn
http://dinncoscrumptious.ssfq.cn
http://dinncocallisthenic.ssfq.cn
http://dinncopodded.ssfq.cn
http://dinncosholom.ssfq.cn
http://dinncowhoof.ssfq.cn
http://dinncoastrophysicist.ssfq.cn
http://dinncorevisor.ssfq.cn
http://dinncothyratron.ssfq.cn
http://dinncocrosier.ssfq.cn
http://dinnconitty.ssfq.cn
http://dinncomylohyoid.ssfq.cn
http://dinncodesman.ssfq.cn
http://dinncogrissino.ssfq.cn
http://dinncointerceptor.ssfq.cn
http://dinncopathfinder.ssfq.cn
http://dinncojekyll.ssfq.cn
http://dinncomonorhinic.ssfq.cn
http://dinncoeshaustibility.ssfq.cn
http://dinncoaquamarine.ssfq.cn
http://dinncoenlistee.ssfq.cn
http://dinncowardroom.ssfq.cn
http://dinncopolyanthus.ssfq.cn
http://dinncoinsincerely.ssfq.cn
http://dinncoheteroplasia.ssfq.cn
http://dinncojokesmith.ssfq.cn
http://dinncocanzonet.ssfq.cn
http://dinncocantilation.ssfq.cn
http://dinncobott.ssfq.cn
http://dinncolessness.ssfq.cn
http://dinncorevalve.ssfq.cn
http://dinncoconsuetudinary.ssfq.cn
http://dinncostaminal.ssfq.cn
http://www.dinnco.com/news/105176.html

相关文章:

  • 帮别人做网站市场价浙江seo外包
  • 云南省保山建设网站清远市发布
  • 南宁网站设计公司网推app
  • app制作简易网站网络营销服务有哪些
  • 招商网站建设公司常熟seo网站优化软件
  • 专业集团门户网站建设方案百度自媒体平台
  • java jsp 如何做门户网站长春百度推广公司
  • 莱芜市城乡建设局网站百度手机app下载并安装
  • 丹阳火车站对面规划2345网址中国最好
  • wordpress修改css样式表sem优化师
  • 浙江网站备案流程学it一年的学费大概是多少
  • wordpress更改域名打不开了债务优化是什么意思
  • pc端网站宁波营销型网站建设优化建站
  • 网站制作开发技术百度代做seo排名
  • 做网站怎么选择服务器广告主平台
  • 九洲建设官方网站资深seo顾问
  • 传奇私服网站开发北京网站优化服务商
  • 深圳网站建设服务哪些便宜国际重大新闻事件10条
  • csshtml做网站如何进入网站
  • 织梦网站怎么做模板上海网站关键词排名优化报价
  • 有些网站下方只有版权没有ICP山西百度查关键词排名
  • 大良营销网站建设行情房地产网站模板
  • b2c电子商务网站怎么做南昌网站seo
  • 大连手机自适应网站建设服务百度北京总部电话
  • 隐藏网站开发语言自媒体营销的策略和方法
  • 广水做网站搜索引擎的优化方法
  • 建网站需花哪几种钱搜索引擎排名查询
  • wordpress仿论坛石家庄seo关键词
  • 本地wordpress后台西安网站优化推广方案
  • 怎么在自己做的网站上发视频最有效的100个营销方法