GithubHelp home page GithubHelp logo

zhaomingyuan6339 / ts-todo Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 5.36 MB

一个基于typescript的todolist案例,代码风格高度解耦合,模块化开发,感谢B站“前端小野森森”老师的无私分享,非常值得学习的编程**

HTML 8.32% TypeScript 76.15% CSS 15.53%

ts-todo's Introduction

传统写法

1.绑定事件处理函数 1.增加项-列表数据 -> 增加一项 {id timestamp, content string ,completed:false} 每一项的视图 -> 列表 2. 删除项 - 列表数据 -> id -> removeItem 将对应项的视图 -> 列表 -> 删除 3. 改变完成状态 - 列表数据 -> id -> change completed 2.将对应项的完成状态 -> 是否完成 toggle

面向对象、类的继承、横向切割程序 -> 设计方案

1.将程序进行分类 外层:浏览器的事件 -> 调用方法 -> 事件处理函数的绑定 操作数据: addTodo、removeTodo、toggleComplete 操作DOM:addItem、removeItem、changeCompleted 管理模板:TODOView -> 接收参数

ts-todo's People

Contributors

zhaomingyuan6339 avatar

Stargazers

Yan avatar

Watchers

 avatar

Forkers

cgb-vue3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.