-
表格的拖拽排序功能---应用splice方法
摘要:1.引入sortablejs文件 import Sortable from 'sortablejs' 2.代码 合理运用splice方法,删掉旧索引的对象,再以新索引把旧对象重新加回去 methods: { async getList() { this.listLoading = true cons
阅读全文
-
ES6方法的特性总结
摘要:1.filter 返回新数组(筛选) var thenew = [1,2,3,4,5]; var theold = [4,3,2,1]; var thefilter = thenew.filter( i => theold.indexOf(i) >= 0 ); console.log(thefilt
阅读全文
-
template functional
摘要:1.functional 是什么? 它是函数式组件的一个标记,如果一个组件没有管理任何状态,也没有监听任何传递给它的状态,没有声明周期方法。实际上,它只是接收一些props的函数,在这种场景下,我们可以将组件标记为functional,这意味着它无状态(没有响应式数据),也没有实例(没有this上下
阅读全文
-
scrollTop, offsetTop, pageYOffset, scrollY 的区别
摘要:1.scrollTop DOM对象的scrollTop用于获取或者设置一个元素里滚动的距离(垂直)。例如:document.documentElement.scrollTop可以获取当前页面的滚动高度,也可以获取某个DOM元素的滚动距离,例如:document.querySelector('.con
阅读全文
-
Sass @mixin 与 @include
摘要:@mixin 指令允许我们定义一个可以在整个样式表中重复使用的样式。 @include 指令可以将混入(mixin)引入到文档中。 1.@mixin定义一个混入 混入(mixin)通过 @mixin 指令来定义。 @mixin name { property: value; property: va
阅读全文
-
关于Vue中props的详解
摘要:官方文档: 组件实例的作用域是孤立的。这意味着不能 (也不应该) 在子组件的模板内直接引用父组件的数据。父组件的数据需要通过 prop 才能下发到子组件中。 也就是props是子组件访问父组件数据的唯一接口。 详细一点解释就是: 一个组件可以直接在模板里面渲染data里面的数据(双大括号)。 子组件
阅读全文
-
前端开发工具宝典
摘要:1、Responsively App:网页调试必备法宝 现在的大厂越来越重视网页在移动端的使用体验,是移动端的尺寸和型号太多,在不同的移动端上进行设备调试是个非常繁琐的工作。虽然Chrome 浏览器默认的工具也还不错,但是一次只能针对一种尺寸,开发成本相对还是高了一些。 Responsively 最
阅读全文
-
前端js开发常用的60种工具方法
摘要:1.邮箱 export const isEmail = (s) => { return /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s) } 2.手机号码 export const isMobile =
阅读全文
-
element ui table表格里面插槽的使用方法
摘要:1. 元素 <el-table :data="tableData" style="width: 100%"> <el-table-column prop="date" label="DATE"> </el-table-column> <el-table-column label="ACCOUNT N
阅读全文
-
vue.js自定义组件directives
摘要:参考---https://blog.csdn.net/hant1991/article/details/74626002
阅读全文
-
vue中watch - deep
摘要:参考---https://blog.csdn.net/hdchangchang/article/details/89337971
阅读全文
-
VUE—— transition(过渡&动画)的简单使用
摘要:对要使用动画的组件或者模块包上一层transition标签, <transition name="fade"> <p v-if="show">hello</p> </transition> name是自己命名的class的名称,用来写动画样式,如果不写name 则默认是v对应样式名称如下:写样式的时
阅读全文
-
vue中component标签的使用
摘要:dom部分 <template> <div id="app"> <component :is="key"></component> </div> </template> js部分 <script> var componentA = { template: `<div style="color:red
阅读全文
-
Window(窗口)和Document(文档)对象
摘要:关于javascript的文档和窗口对象之间的区别似乎存在很多误解。 窗口对象和文档对象不一样!!!! 我已着手以最直观的方式为您澄清这一点。 那么,您要求的文档对象和窗口对象之间有什么区别?好问题。 好吧,窗口是首先加载到浏览器中的东西。此窗口对象具有大多数属性,如length,innerWidt
阅读全文
-
Fuse.js——用于JavaScript中数据的模糊搜索
摘要:参考 http://www.dreamwu.com/post-1876.html
阅读全文
-
this.$emit()的用法
摘要:参考---https://blog.csdn.net/qq_26386437/article/details/108590530
阅读全文
-
Vue中的template标签的使用和在template标签上使用v-for
摘要:参考---https://www.cnblogs.com/taohuaya/p/10686420.html
阅读全文
-
Vue插槽的理解和使用
摘要:参考---https://www.cnblogs.com/mandy-dyf/p/11528505.html
阅读全文
-
浅识 js中return的用法
摘要:参考---https://blog.csdn.net/jiaodeqiangs/article/details/100579092
阅读全文
-
JavaScript中getBoundingClientRect()方法详解
摘要:<!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Document</title> <style type="text/css"> * { padding: 0px; margin: 0px; } #mai
阅读全文
-
[HTML5] document.hidden
摘要:参考---https://www.cnblogs.com/mytianying/p/5668507.html
阅读全文
-
在vue页面中设置resize事件
摘要:写法: beforeMount() { window.addEventListener('resize', this.$_resizeHandler) }, beforeDestroy() { window.removeEventListener('resize', this.$_resizeHan
阅读全文
-
document之ES6解构
摘要:1.解构写法 const { body,head } = document 2.控制台打印 body和head const { body,head } = document console.log(document); console.log(body); console.log(head); 效果
阅读全文
-
vue中mixins的使用方法和注意点---mixins第二篇(异步请求的情况)
摘要:参考---https://www.cnblogs.com/Ivy-s/p/10022636.html
阅读全文
-
vue中mixins的使用方法和注意点---mixins第一篇
摘要:参考---https://www.cnblogs.com/Ivy-s/p/9937173.html
阅读全文
-
vue中路由重定向redirect
摘要:参考---https://www.cnblogs.com/vickylinj/p/10901896.html
阅读全文
-
如何理解dispatch( 'tagsView/delAllViews',null,{root:true} )里面的root:true
摘要:如何理解dispatch( 'tagsView/delAllViews',null,{root:true} )里面的root:true:调用父级的actions或者mutations 1.首先看下vues文件的结构 2.dispatch的一般用法,引用的是一个文件内的代码 3.如果想引用另外一个文件
阅读全文
-
vue计算属性computed中的get和set的使用
摘要:参考---https://fullstack.blog.csdn.net/article/details/105598342
阅读全文
-
splice(0)的奇妙用法
摘要:参考---https://www.icode9.com/content-1-93975.html
阅读全文
-
for循环里的break,continue和return有什么差别
摘要:1.break(for循环) 此语句导致整个for循环程序终止,并进行for循环后面的紧接着的代码,即,不是跳到下一个循环周期而是退出循环。如果break语句包含在嵌套循环里,它只跳出最里面的循环。 function fn (){ for(var i=0; i<10; i++){ if(i==3){
阅读全文
-
vue通过路由跳转实现重定向
摘要:1.vue通过路由跳转实现重定向 this.$router.replace({ path: '/redirect' + view.fullPath }); 2.通过路由跳转到制定的路径 this.$router.push(latestView.fullPath) 3.通过路由跳转到根目录 this.
阅读全文
-
TypeScript 中slice(-1)是什么意思?
摘要:参考---https://blog.csdn.net/qq_41576643/article/details/107364239
阅读全文
-
vue使用watch监听data的变化
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv
阅读全文
-
JavaScript addEventListener()事件监听方法
摘要:参考-https://blog.csdn.net/wangningjing87/article/details/100707744
阅读全文
-
通过递归的思维来获取:包含affix: true键值对路由器的绝对路径(父路由和子路由)
摘要:1.路由代码 4个路由对象 var router = [ { path: '/', component: Layout, redirect: '/dashboard', children: [ { path: 'dashboard', component: () => import('@/views
阅读全文
-
path.resolve()的终极理解
摘要:参考---https://blog.csdn.net/iconhot/article/details/89257576
阅读全文
|