1 Star 16 Fork 2

Zou/lesson_zp

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
demo.html 930 Bytes
一键复制 编辑 原始数据 按行查看 历史
Zou 提交于 2025-12-11 22:58 +08:00 . Todos 任务清单 VUE开发思路
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h2 id="app"></h2>
<input type="text" id="todo-input">
<script>
// 先找到DOM元素 命令式 机械的 性能差的
// JS(V8 快) -> HTML(渲染引擎 慢) vue底层也做,代替我们做
// vue 让新手写的代码质量更好,容易入门 v-for {{}} ref
// 响应式,数据驱动,可以更好的基于业务
const app = document.getElementById('app')
const todoInput = document.getElementById('todo-input')
todoInput.addEventListener('change', function(event) {
const todo = event.target.value.trim();
if (!todo) {
console.log('请输入任务');
return;
}
// 渲染到页面
app.innerHTML = todo;
})
</script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/giaoZou/lesson_zp.git
git@gitee.com:giaoZou/lesson_zp.git
giaoZou
lesson_zp
lesson_zp
master

搜索帮助