随笔分类 -  vue

vue
摘要:由于有些业务组件需要定义多个响应式props,类似这种(比较懒,没上ts),在vue3.3.x以前,如果不用三方库,代码会变得很繁琐 <script setup> const props = defineProps({ modelValue: { type: Object, default: () 阅读全文
posted @ 2023-09-15 17:32 豌里个豆 阅读(3460) 评论(0) 推荐(0)
摘要:配置文件tsconfig.json的paths属性 "paths": { "@components/*": ["src/components/*"], "@assets/*": ["src/assets/*"], // css, html中需要 `~@assets/*` } config/index 阅读全文
posted @ 2021-12-17 11:35 豌里个豆 阅读(128) 评论(0) 推荐(0)
摘要:检查template中是否存在和reactive变量相同的ref!!!!! 阅读全文
posted @ 2021-12-11 07:54 豌里个豆 阅读(591) 评论(0) 推荐(0)
摘要:环境 vscode typescript4 vue3 问题描述 引入子组件报错 问题解决 去除子组件中定义为空的props及其他无用optional API。 阅读全文
posted @ 2021-12-08 17:56 豌里个豆 阅读(6036) 评论(0) 推荐(0)
摘要:环境 vscode typescript4 vue3 问题描述 首先,vue3中的全局变量及方法的配置较vue2中的变化大家应该已经知道了,不清楚的可以查看官方说明,但是按照官方文档结合typescript使用时遇到了问题: axios.ts // axios.ts import axios fro 阅读全文
posted @ 2021-12-08 11:10 豌里个豆 阅读(14790) 评论(3) 推荐(0)
摘要:网页可见区域宽: document.body.clientWidth 网页可见区域高: document.body.clientHeight 网页可见区域宽: document.body.offsetWidth (包括边线的宽) 网页可见区域高: document.body.offsetHeight 阅读全文
posted @ 2021-11-25 13:12 豌里个豆 阅读(230) 评论(0) 推荐(0)
摘要:vue3 的 router-view keep-alive写法: <router-view v-slot="{ Component, route }"> <keep-alive :include="includeList"> <component :is="Component" :key="rout 阅读全文
posted @ 2021-11-17 14:28 豌里个豆 阅读(2918) 评论(0) 推荐(1)
摘要:不能再computed中改变页面变量的值,如果需要改变,请使用watch 阅读全文
posted @ 2021-07-27 14:24 豌里个豆 阅读(362) 评论(0) 推荐(0)
摘要:directive.js import Vue from 'vue' // 提交验证 Vue.directive('clickOutside', { // 初始化指令 bind(el, binding, vnode) { function clickHandler(e) { // 这里判断点击的元素 阅读全文
posted @ 2021-07-09 13:13 豌里个豆 阅读(1087) 评论(0) 推荐(0)