Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lyhue1991 committed Dec 30, 2024
1 parent f88afc9 commit 440cb95
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 23 deletions.
34 changes: 21 additions & 13 deletions 00_push_to_github.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 1,
"id": "b944d36f",
"metadata": {},
"outputs": [],
Expand All @@ -66,16 +66,24 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 2,
"id": "8ebe4578",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[main 9bd8fa3] update\n",
" 1 file changed, 36 insertions(+), 29 deletions(-)\n"
"[main f88afc9] update\n",
" 13 files changed, 385 insertions(+), 111 deletions(-)\n",
" create mode 100644 dist/assets/index-BUSVGecg.css\n",
" delete mode 100644 dist/assets/index-C0XbBy_3.css\n",
" create mode 100644 dist/assets/index-Cm-37xAo.js\n",
" delete mode 100644 dist/assets/index-DmglhP25.js\n",
" create mode 100644 src/components/Celebrate.vue\n",
" delete mode 100644 src/components/HelloWorld.vue\n",
" create mode 100644 src/components/TodoItem.vue\n",
" create mode 100644 src/components/TodoList.vue\n"
]
}
],
Expand All @@ -85,7 +93,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 3,
"id": "abc1e236",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -122,23 +130,23 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 4,
"id": "446062d3",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Enumerating objects: 5, done.\n",
"Counting objects: 100% (5/5), done.\n",
"Enumerating objects: 26, done.\n",
"Counting objects: 100% (26/26), done.\n",
"Delta compression using up to 8 threads\n",
"Compressing objects: 100% (3/3), done.\n",
"Writing objects: 100% (3/3), 915 bytes | 915.00 KiB/s, done.\n",
"Total 3 (delta 2), reused 0 (delta 0), pack-reused 0\n",
"remote: Resolving deltas: 100% (2/2), completed with 2 local objects.\u001b[K\n",
"Compressing objects: 100% (16/16), done.\n",
"Writing objects: 100% (16/16), 31.00 KiB | 7.75 MiB/s, done.\n",
"Total 16 (delta 4), reused 0 (delta 0), pack-reused 0\n",
"remote: Resolving deltas: 100% (4/4), completed with 4 local objects.\u001b[K\n",
"To github.com:lyhue1991/hellojs.git\n",
" b526533..9bd8fa3 main -> main\n",
" 9bd8fa3..f88afc9 main -> main\n",
"branch 'main' set up to track 'origin/main'.\n"
]
}
Expand Down

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue</title>
<script type="module" crossorigin src="/assets/index-Cm-37xAo.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BUSVGecg.css">
<title>todo</title>
<script type="module" crossorigin src="/assets/index-BtA2bDWP.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-xSoC-U-G.css">
</head>
<body>
<div id="app"></div>
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue</title>
<title>todo</title>
</head>
<body>
<div id="app"></div>
Expand Down
8 changes: 7 additions & 1 deletion src/components/TodoList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,17 @@
import { ref, computed, watch } from 'vue'
import TodoItem from './TodoItem.vue'
const todos = ref([])
// 从 LocalStorage 获取保存的待办事项,如果没有则使用空数组
const todos = ref(JSON.parse(localStorage.getItem('todos') || '[]'))
const newTodo = ref('')
const isCollapsed = ref(true)
const draggedItem = ref(null)
// 监听 todos 的变化,保存到 LocalStorage
watch(todos, (newTodos) => {
localStorage.setItem('todos', JSON.stringify(newTodos))
}, { deep: true }) // 使用 deep 选项以监听数组内部的变化
const visibleTodos = computed(() => {
return isCollapsed.value ? todos.value.slice(0, 3) : todos.value
})
Expand Down

0 comments on commit 440cb95

Please sign in to comment.