会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
xjZhang
博客园
首页
新随笔
联系
订阅
管理
2024年7月24日
父组件向后代组件传递响应式数据以及在子组件中更改数据内容
摘要: 方法: 1、父组件使用provide提供数据和修改数据的函数 2、后代组件使用inject接收数据并触发函数 完整代码: 1、App.vue 点击查看代码 <script setup> import{provide,ref}from 'vue' import myComponent from "./
阅读全文
posted @ 2024-07-24 10:59 xjZhang
阅读(131)
评论(0)
推荐(0)
2024年7月23日
Vue子组件向父组件传递事件
摘要: 注:Vue3版本 主要流程: 1、父组件向子组件传递监听事件 点击查看代码 <myComponent @getMessage="getMessage"/> 2、子组件使用emit机制添加要监听的事件 点击查看代码 const emit=defineEmits(['getMessage']) 3、子组
阅读全文
posted @ 2024-07-23 22:35 xjZhang
阅读(61)
评论(0)
推荐(0)
2024年7月22日
ref和reactive分别编写的计数器
摘要: 使用ref函数和reactive函数写的技术器小程序,ref的实现用到了reactive,推荐使用ref,代码 点击查看代码 <script > //setup是组合是API的体现 import {reactive, ref} from 'vue' export default{ setup() {
阅读全文
posted @ 2024-07-22 22:27 xjZhang
阅读(33)
评论(0)
推荐(0)
黑马小兔鲜笔记1
摘要: 技术栈:
阅读全文
posted @ 2024-07-22 21:06 xjZhang
阅读(46)
评论(0)
推荐(0)
2024年5月24日
vue生命周期
摘要: 生命周期就是vue创建dom流程中可调用的函数,共有八个: 1、beforeCreate:此时无法通过vm访问到data中的数据、methods中的方法; 2、created:可以通过vm访问到data中的数据、methods中配置的方法; 3、生成虚拟dom; 4、beforeMount:页面呈现
阅读全文
posted @ 2024-05-24 20:25 xjZhang
阅读(41)
评论(0)
推荐(0)
2024年4月25日
HTML+CSS热词设计
摘要: HTML+CSS的热词设计效果 代码: 点击查看代码 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-s
阅读全文
posted @ 2024-04-25 15:45 xjZhang
阅读(45)
评论(0)
推荐(0)
2024年4月17日
JS-电梯导航(显示和返回效果)
摘要: 效果说明:(1)当下拉滚动轴超过300px时,显示电梯导航 (2)点击返回顶部,立即返回顶部 点击查看代码 <body> <script> //效果说明(1)当下拉滚动轴超过300时,显示电梯导航 //(2)点击返回顶部,立即返回顶部 const elevator = document.queryS
阅读全文
posted @ 2024-04-17 22:29 xjZhang
阅读(97)
评论(0)
推荐(0)
公告