摘要: 能正确打印h1标签宽度的方法 <div id="app"> <h1 ref="h1" v-if="show">nowcoder</h1> </div> <script> new Vue({ el: '#app', data: { show: false }, mounted() { this.sho 阅读全文
posted @ 2021-11-20 21:09 慕斯星球 阅读(353) 评论(0) 推荐(0)
摘要: setInterval()是周期性定时器 setTimeout()是一次性定时器 今天的重点不是比较它俩的区别,而是比较其中的参数回调函数: setTimeout(()=>{ console.log(this) }) setTimeout(function (){ console.log(this) 阅读全文
posted @ 2021-11-20 21:02 慕斯星球 阅读(400) 评论(0) 推荐(0)
摘要: 核心逻辑是点击某个li块时,将当前下标赋值给data变量curIndex,利用绑定动态class,判断当前index和curIndex是否一样来控制style样式。 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <tit 阅读全文
posted @ 2021-11-20 17:46 慕斯星球 阅读(53) 评论(0) 推荐(0)
摘要: 快捷键: ctrl + shift + - 折叠 ctrl + shift + + 展开 ctrl + shift + f 全局搜索代码 shift + shift 全局搜索文件 ctrl + alt + s 设置 阅读全文
posted @ 2021-10-21 18:17 慕斯星球 阅读(29) 评论(0) 推荐(0)
摘要: Vue Router v3.4 基础 起步 动态路由匹配 嵌套路由 编程式导航 命名路由 命名视图 重定向和别名 路由组件传参 HTML5 History模式 进阶 导航守卫 路由原信息 过渡动效 数据获取 滚动行为 路由懒加载 导航故障 API参考 Vue Router 4.0 (改动m/添加i) 阅读全文
posted @ 2021-10-18 01:36 慕斯星球 阅读(57) 评论(0) 推荐(0)
摘要: Do not use built-in or reserved HTML elements as component id: details 不要使用内置或保留的HTML元素作为组件:details 一般是组件名发生了冲突,或者组件下name和路由中定义的name不一致。 阅读全文
posted @ 2021-09-24 21:14 慕斯星球 阅读(336) 评论(0) 推荐(0)
摘要: TypeError: name.toUpperCase is not a function 多为axios请求时设置header出现的问题。 正确写法: this.$axios.post('/recipe/byclass', { classid: 2, start: 0, num: 10, appk 阅读全文
posted @ 2021-09-23 20:07 慕斯星球 阅读(698) 评论(0) 推荐(0)
摘要: error Elements in iteration expect to have 'v-bind:key' directives vue/require-v-for-key 在vue2.2+版本中,当组件使用v-for时,设置v-bind:key是必须的。 可以使用以下几种解决方式: 设置v-b 阅读全文
posted @ 2021-09-22 22:37 慕斯星球 阅读(1453) 评论(0) 推荐(0)
摘要: Access to XMLHttpRequest at '…' from origin '…' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested r 阅读全文
posted @ 2021-09-22 22:36 慕斯星球 阅读(5265) 评论(0) 推荐(1)
摘要: ERROR Failed to compile with 1 error error in ./src/views/Details.vue Module Error (from ./node_modules/eslint-loader/index.js): C:\Users\SGQ\Desktop\ 阅读全文
posted @ 2021-09-22 22:34 慕斯星球 阅读(900) 评论(0) 推荐(0)