随笔分类 -  vue3

摘要:众所周知,vue2有生命周期,而vue3也有 而vue2的created和beforecreated在vue3中都由setup替代了 <script setup lang="ts"> import { onBeforeMount, onMounted, onBeforeUpdate, onUpdat 阅读全文 »
posted @ 2024-03-13 16:51 文采呱呱 阅读(11) 评论(0) 推荐(0) 编辑
摘要:父组件 <script setup lang="ts"> import person from '@/components/person.vue' import { ref, reactive, defineProps } from 'vue' import { type Person } from 阅读全文 »
posted @ 2024-03-13 15:49 文采呱呱 阅读(10) 评论(0) 推荐(0) 编辑
摘要:储存标记中的内容 <template> <div class="about"> <h1 ref="Holly">你好</h1> <button @click="hhh">点击输出上述h1</button> </div> </template> <script lang="ts" setup> imp 阅读全文 »
posted @ 2024-03-07 22:24 文采呱呱 阅读(7) 评论(0) 推荐(0) 编辑
摘要:<template> <div class="about"> <p>情况一,监事ref的值</p> <h1>求和 {{sum}}</h1> <button @click="changeSum">++++</button> </div> </template> <script lang="ts" se 阅读全文 »
posted @ 2024-03-03 22:00 文采呱呱 阅读(86) 评论(0) 推荐(0) 编辑
摘要:计算属性有缓存的,方法没有缓存 下列的计算案例是只读的,不可修改的 上述代码为只读属性,优化后 <script setup lang="ts"> import { ref, computed } from 'vue' let name = ref("zhang") let xing = ref("s 阅读全文 »
posted @ 2024-02-29 17:50 文采呱呱 阅读(25) 评论(0) 推荐(0) 编辑
摘要:ref可以创建基本类型和对象类型的响应数据: reaction可以创建响应式对象数据: ref和reactive的区别:ref:定义基本类型和对象,ref创建的对象,必须使用.valuereactive:定义对象的,重新分配一个对象时,会失去响应式(如果实在想改,可以用Object.assign() 阅读全文 »
posted @ 2024-02-29 16:52 文采呱呱 阅读(28) 评论(0) 推荐(0) 编辑
摘要:https://www.cnblogs.com/chyingp/p/websocket-deep-in.html 阅读全文 »
posted @ 2024-01-02 11:44 文采呱呱 阅读(5) 评论(0) 推荐(0) 编辑
摘要:npm init vue@latest 看需求选择 紧接着cd 到自己的项目文件下 npm i一下安装依赖 npm run dev 启动项目 阅读全文 »
posted @ 2023-12-05 14:10 文采呱呱 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 阅读全文 »
posted @ 2023-03-22 10:21 文采呱呱 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 阅读全文 »
posted @ 2023-03-22 10:20 文采呱呱 阅读(58) 评论(0) 推荐(0) 编辑
摘要: 阅读全文 »
posted @ 2023-03-22 10:19 文采呱呱 阅读(12) 评论(0) 推荐(0) 编辑
摘要:调用: console.dir(Promise) Promise是一个构造函数,自己身上有all、reject、resolve这几个眼熟的方法,原型上有then、catch等同样很眼熟的方法 宏任务:普通任务,正常执行。正常的异步任务都是宏任务,最常见的就是定时器(setInterval, setI 阅读全文 »
posted @ 2023-03-22 10:18 文采呱呱 阅读(16) 评论(0) 推荐(0) 编辑
摘要:vue3官网:https://cn.vuejs.org/guide/introduction.html Webpack 入门教程:https://www.runoob.com/w3cnote/webpack-tutorial.html vue 谷歌调试工具:https://chrome.zzzmh. 阅读全文 »
posted @ 2022-11-15 15:46 文采呱呱 阅读(23) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示