el-select 获取change点击index el-select 获取change点击index 1 2 3 <el-select> <el-option v-for="(item, index) in optionlist"@click.native ="handleSelect(index)"></el-option> </el-select>
Vue+elemnet UI table表格使用print.js打印 1.npm 安装priint.js2.vue页面引用import * as Printjs from "print-js";3.<el-table id="printCons" :data="tableData" stripe style="width: 100%; margin-top: 30px" border v-loading="loading" >
vue中ref的作用 vue中的ref其实功能很强大,下面介绍一下如何使用。基本用法,本页面获取dom元素<template> <div id="app"> <div ref="testDom">11111</div> <button @click="getTest">获取test节点</button> </div></template><script>export default
js把两个对象个并为一个对象 Object.assign()基本用法Object.assign方法用于对象的合并,将源对象(source)的所有可枚举属性,复制到目标对象(target)。const target = { a: 1 };const source1 = { b: 2 };const source2 = { c: 3 };Object.assign(target, source1, source2);target // {a:1, b:2, c:3}Object.assign方法的第一个参
摇篮兔pc端页面适配总结 头部若显示不开可以不加min-weight中间内容content部分min-weight:1280pxcontent中内容最小宽度不要大于1280px,否则会右侧有空白页面分模块布局布局方式一:pageWidth外面的图片做背景图片,起到撑起整个盒子高度作用pageWidth绝对定位 :.yy-bannerContainer .pageWidth { position: absolute; left: 12.5%; top: 0; z...
select第一个选不上 解决方法: 1 2 3 4 5 6 7 <select id="zhouqi"class="select"size="1"name="periodicId"style="color:gray;"> <option value="0"selected="selected"style="display: n...
url传中文参数乱码 encodeURI 编码 解码encodeURI();编码 解码都是这个方法实例:// 编码 $(".index-search").bind('keydown',function(event){ var text = encodeURI($(this).val()); if(event.keyCode == "13") { window.open("search-list.html?keyword="+text);
JQuery清空dom下的所有节点 $(".left-list .item-box").empty();2.清空元素下的某些特定节点$("#mulu_rongqi").find("li").remove();
jquery实时获取input的输入值 $("#btn-search").bind('input propertychange', function() { var a = $("#btn-search").val(); console.log(a); })
JS字符串截取(获取指定字符后面的所有字符内容) function getCaption(obj){ var index=obj.lastIndexOf("\-"); //获取-后边的字符串 obj=obj.substring(index+1,obj.length);// console.log(obj); return obj;}var str=" 执法办案流程-立案审批";getCaption(str);最后得到的结果是立案审批...
前端知识整理(1)js篇 1 声明1-1 [js函数声明的三种方式:](1)Function()构造器var f = new Function()(2)函数声明function f (){ console.log(111); }(3)函数表达式var f = function(){ console.log(222);}1-2 [js变量声明:]1.var声明的变量会挂载在window上,而let和const声明的变量不会2.var声明.
前端面试必问题整理(1) 必问题,必问题,必问题,1,vue响应式原理?详细说一下过程。1.1 什么是Vue响应式呢“数据发生变化后,会重新对页面渲染,这就是Vue响应式”1.2 想完成这个过程,我们需要做些什么...
js函数作用域 变量提升 JavaScript 拥有函数作用域:每个函数创建一个新的作用域。作用域决定了这些变量的可访问性(可见性)。函数内部定义的变量从函数外部是不可访问的(不可见的)。js:var a = 111; function f() { console.log(a); var a = -1; console.log(a); } f();控制台:你可能会想当然的认为alert()第一次显示的是123(即全局变量a的..
js截取?后的所有字符串 var herf = http://127.0.0.1:5500/detail.html?id=24herf = href.split("?id=")[1]split("xxx")[1]可以截取xxx后的所有字符串
.html()进去的内容,添加ckick事件 html:<!-- 案例展示 --> <div class="case"> <div class="index-title"> 案例展示 </div> <div class="item-box"> </div> <div class="more"> 点击加载更
js 数组渲染到html页面 html页面<div class="friends"> <div class="index-title"> 玩家伙伴 </div> <div class="top"> <div class="title"> 车圈厂牌 </div> <div class