随笔分类 -  vue

摘要:基本概念 Entry Points:每个页面都有自己的入口点(entry point),例如 main-index.js 和 main-about.js。这是每个页面的起点,定义了该页面需要加载的所有资源。 Chunks:由 Webpack 生成的 JavaScript 文件块。每个页面会有自己的 阅读全文
posted @ 2024-09-20 11:28 DurianTRY 阅读(212) 评论(0) 推荐(0) 编辑
摘要:HtmlWebpackPlugin 1.作用 自动创建HTML 自动创建HTML:在构建过程中自动生成一个HTML5文件,该文件可以包含所有webpack打包过程中生成的bundles。这意味着你不需要手动创建HTML文件,插件会为你处理这一切。 自动注入资源:自动将打包生成的JavaScript、 阅读全文
posted @ 2024-09-11 08:54 DurianTRY 阅读(381) 评论(0) 推荐(0) 编辑
摘要:``` // 动态修改浏览器图标 getIcon() { // this.favicon 是浏览器图标的地址 或者路径 if (this.favicon) { let link = document.querySelector("link[rel*='icon']") || document.cre 阅读全文
posted @ 2023-08-29 09:40 DurianTRY 阅读(204) 评论(0) 推荐(0) 编辑
摘要:## 语法 语法 otherWindow.postMessage(message, targetOrigin, [transfer]); otherWindow 其他窗口的一个引用,例如向子窗口发送 则otherWindow 是子窗口的window对象 ## 父页面向子页面Iframe通信 ``` 阅读全文
posted @ 2023-08-28 15:32 DurianTRY 阅读(408) 评论(0) 推荐(0) 编辑
摘要:1.目的 列表页进入详情页时缓存并记录滚动位置,返回列表页面不重新请求数据并滚动到离开时的位置 2.实现 2.1.单页面 不管是浏览器前后退 还是router-link前后退都生效 <router-view v-slot="{ Component }"> <keep-alive :include=" 阅读全文
posted @ 2023-06-14 09:40 DurianTRY 阅读(812) 评论(0) 推荐(0) 编辑
摘要:官方文档 https://github.com/axios/axios#cancellation Cancellation AbortController Starting from v0.22.0 Axios supports AbortController to cancel requests 阅读全文
posted @ 2023-02-07 10:40 DurianTRY 阅读(530) 评论(0) 推荐(0) 编辑
摘要:el-tree 默认选中第一项 必须结合 current-node-key属性和this.$refs['treeRef'].setCurrentKey()方法及this.$nexTick()同时使用 <el-tree ref="tree" accordion :data="departmentDat 阅读全文
posted @ 2022-05-20 15:15 DurianTRY 阅读(117) 评论(0) 推荐(0) 编辑
摘要:作者不知道是谁了 方式一: 子组件 <template> <div> <div>儿子:{{msg}}</div> <button @click="childBtn">儿子</button> </div> </template> <script> export default { name: 'Chi 阅读全文
posted @ 2022-05-18 14:40 DurianTRY 阅读(430) 评论(0) 推荐(0) 编辑
摘要:Vue3.0路由 -- 学习笔记 1.在新建项目时选择Router 之后打开项目,就会在项目目录下有如下:router文件夹下配置路由,views里编辑路由跳转页面 2.路由的路径配置都在index.js文件里, import { createRouter, createWebHistory } f 阅读全文
posted @ 2021-03-25 15:23 DurianTRY 阅读(1479) 评论(0) 推荐(0) 编辑
摘要:Vue学习笔记 一切Vue项目都从一个vue实例开始 var vm = new Vue() <body> <div id="app"> {{ message }} {{ date }} </div> </body> <script src="https://unpkg.com/vue/dist/vu 阅读全文
posted @ 2020-12-30 16:41 DurianTRY 阅读(79) 评论(0) 推荐(0) 编辑

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