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