自定义指令 当指令不满足需求时,可以自定义指令,语法如下: Vue.directive('focus',{ inserted: function(el){ //el表示指令所绑定的元素 el.focus() } }) 使用方法和其他指令一样 <input type="text" v-focus> 带 ...
分类:
其他好文 时间:
2020-12-18 13:03:56
阅读次数:
3
let obj={ name:'金毛' } function test(){ console.log(123,this) } test.call(obj,'123') //手写 Function.prototype.myCall=function(thisObj,arr){ let Fn = thi ...
分类:
其他好文 时间:
2020-12-18 12:55:04
阅读次数:
3
1 promise.then(function(value) { 2 // success 3 }, function(error) { 4 // failure 5 }); then本质上是一个函数,因为then存在于对象之中,所以又叫做方法。将then当做一个函数就ok了。 then有两个参数, ...
分类:
其他好文 时间:
2020-12-18 12:46:53
阅读次数:
3
1 type testName = 'lx' | 'bj' | 'cd' | 1; 2 3 function testFun(arg1: testName){ 4 5 } 6 testFun('lx'); //正确 7 testFun(1); //正确 8 testFun('ll'); //错误 ...
分类:
其他好文 时间:
2020-12-18 12:35:08
阅读次数:
2
function getCacheData(key: string): any { return (window as any).cache[key]; } interface Cat { name: string; run(): void; } const tom = getCacheData(' ...
分类:
其他好文 时间:
2020-12-18 12:29:58
阅读次数:
2
CREATE OR REPLACE FUNCTION "F_UPPER_MONEY_NEW"(I_NUM in number default null ) return nvarchar2 is /* 处理数字金额转换为汉字表达 --情况1.保留元角分 (默认) 10240035001421.1 / ...
分类:
数据库 时间:
2020-12-17 12:58:22
阅读次数:
7
{ checkbox: true, visible: true, formatter: function (value, row, index) { if(row.isCheck =="1"){ return {disabled : true,} }else{ return {disabled : ...
分类:
其他好文 时间:
2020-12-17 12:54:44
阅读次数:
3
拖拽的实现 在html5还未普及之前,实现元素的拖拽还算是一件比较麻烦的事,大概思路就是监听鼠标移动相关事件,下面是伪代码 odiv.onmousedown = function(ev){ //记录起始位置 } document.onmousemove = function(ev){ //移动目标元 ...
分类:
其他好文 时间:
2020-12-17 12:44:20
阅读次数:
2
函数计算(Function Compute): 函数计算是一个事件驱动的服务,通过函数计算,用户无需管理服务器等运行情况,只需编写代码并上传。函数计算准备计算资源,并以弹性伸缩的方式运行用户代码,而用户只需根据实际代码运行所消耗的资源进行付费。
分类:
Web程序 时间:
2020-12-17 12:21:58
阅读次数:
3
在MybatisPlusConfig中新增bean(3.1.1以下) import com.baomidou.mybatisplus.core.injector.ISqlInjector; import com.baomidou.mybatisplus.extension.injector.Logi ...
分类:
其他好文 时间:
2020-12-17 12:18:23
阅读次数:
2