++
++ Current Count: {{ counter.count }}
++
++```
+\ No newline at end of file
+diff --git "a/\346\235\250\345\217\257\347\233\210/20240516--\350\267\257\347\224\261\345\244\215\344\271\240.md" "b/\346\235\250\345\217\257\347\233\210/20240516--\350\267\257\347\224\261\345\244\215\344\271\240.md"
+new file mode 100644
+index 0000000000000000000000000000000000000000..5a63af70e15fbd2244baf4721c3363144226daef
+--- /dev/null
++++ "b/\346\235\250\345\217\257\347\233\210/20240516--\350\267\257\347\224\261\345\244\215\344\271\240.md"
+@@ -0,0 +1,134 @@
++```js
++import { onMounted, reactive,ref } from 'vue'
++ import {useRouter} from 'vue-router'
++ import axios from 'axios'
++
++ let blogs=reactive([
++
++ ])
++
++ let query=ref('')
++
++ let router=useRouter()
++ onMounted(async()=>{
++ let res=await axios.get(`http://localhost:3000/blogs`)
++ console.log(res);
++ res.data.data.forEach(item=>{
++ blogs.push(item)
++ })
++ })
++
++ function btnAdd(){
++ router.push('/editadd')
++ }
++
++ function btnEdit(id){
++ router.push(
++ {
++ path:`/editadd`,query:{id:id}
++ }
++ )
++ }
++ async function btnQuery(){
++ let res=await axios.get(`http://localhost:3000/blogs?keyword=${query.value}`)
++ blogs.splice(0)
++ console.log(query);
++ res.data.data.forEach(item=>{
++ blogs.push(item)
++ })
++ }
++ async function btnDel(id){
++ if(confirm(`你确定要删除id为${id}的数据吗`)){
++ let index=blogs.findIndex(item=>item.id===id)
++ blogs.splice(index,1)
++ let res=await axios.delete(`http://localhost:3000/blogs/${id}`)
++ console.log(res);
++ }
++ // let res=await axios.delete(`http://localhost:3000/blogs/${id}`)
++ // let idx
++ // if(confirm(`确定删除id为${id}的数据吗`)){
++ // if(res.data.code===1000){
++ // blogs.filter((item,index)=>{
++ // let result=item.id===id
++ // if(result){
++ // idx=index
++ // return
++ // }
++ // })
++ // blogs.splice(idx,1)
++ // }
++ // }
++ }
++
++
++