上一页 1 2 3 4 5 6 ··· 23 下一页
摘要: 在/assets/scss/global.scss中写入样式 $black: #000; $height: 1666px; .test { color: red; background-color: $black; height: $height; } 在/nuxt.config.ts文件中写入如下 阅读全文
posted @ 2024-03-13 13:29 Syinho 阅读(431) 评论(0) 推荐(0) 编辑
摘要: yarn的安装 npm i yarn -g yarn设置镜像源 查看全局镜像源: yarn config get registry 更换淘宝镜像源: yarn config set registry https://registry.npmmirror.com 恢复yarn官方镜像源: yarn c 阅读全文
posted @ 2024-03-01 23:59 Syinho 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 依赖版本 "vite": "^5.0.10" 在vite.config.js中写入以下 export default defineConfig({ plugins: [ vue(), ], // 添加以下配置去除打包后的代码中的console build: { minify: 'terser', t 阅读全文
posted @ 2024-01-12 13:56 Syinho 阅读(486) 评论(0) 推荐(0) 编辑
摘要: 使用的是vue3-count-to组件 安装: npm install vue3-count-to --save 全局注册: // main.js import countTo from 'vue3-count-to' app.use(countTo) 局部引入组件并使用 // xx.vue文件 < 阅读全文
posted @ 2024-01-11 09:13 Syinho 阅读(858) 评论(0) 推荐(0) 编辑
摘要: 一般而言, 在vue中引入图片会使用类似import slideImg1 from '@/assets/imgs/kenny-eliason-Ak5c5VTch5E-unsplash.jpg'这种方式, 但是当需要引入的图片数量众多的时候, 这么写就非常麻烦了. 参考vite+v3批量一次性引入本地 阅读全文
posted @ 2024-01-11 08:53 Syinho 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 在开发中经常遇到需要图片按某个纵横比显示, 并且等比缩放; 比如现有以下需求: 一张header图片, 按照长宽比5:2进行显示并能进行等比缩放 思路: 当padding/margin 的值是百分比时, 是以父元素的宽度来进行计算的 <div id="container"> <div id="con 阅读全文
posted @ 2024-01-09 09:57 Syinho 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 目录常规示例子组件: /components/testCom1.vue父组件: App.vue监听defineExpose返回的数据的变化实现子组件向父组件传递数据父组件中修改子组件defineExpose抛出的数据, 实现父组件向子组件回传数据 官网说明 defineExpose用于子组件向其父组 阅读全文
posted @ 2024-01-06 12:06 Syinho 阅读(953) 评论(0) 推荐(0) 编辑
摘要: indexedDB通过.open(DBName, version)方法连接数据库, 该方法接收两个参数, 分别代表数据库名与数据库版本; 如果该数据库已存在, 那么将会尝试连接该数据库, 如果该数据库不存在, 将会创建; 调用这个方法会返回一个IDBRequest对象 let db, request 阅读全文
posted @ 2023-12-17 00:03 Syinho 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 今天的开发中发现了这个问题 Extraneous non-props attributes (class) were passed to component but could not be automatically inherited because component renders frag 阅读全文
posted @ 2023-11-21 09:37 Syinho 阅读(598) 评论(0) 推荐(0) 编辑
摘要: <div id="container"> <div id="mask"></div> </div> #container { width: 500px; height: 300px; position: relative; border: 1px solid #ccc; background-ima 阅读全文
posted @ 2023-11-16 17:26 Syinho 阅读(8) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 23 下一页