<el-tag type=
"success"
>绿色标签</el-tag>
<el-tag type=
"info"
>灰色标签</el-tag>
写函数也好,还是直接三元表达式都行
1 2 3 |
<el-tag size="medium" :type="scope.row.is_multiple === '否' ? 'info' : 'success'" >{{ scope.row.is_multiple }} </el-tag> |
<el-tag type=
"success"
>绿色标签</el-tag>
<el-tag type=
"info"
>灰色标签</el-tag>
1 2 3 |
<el-tag size="medium" :type="scope.row.is_multiple === '否' ? 'info' : 'success'" >{{ scope.row.is_multiple }} </el-tag> |
解决:
1.this.billItemLIsts = JSON.parse( JSON.stringify(this.billItemLIstsOriginal) );
2.或使用 ES6 的解析语法 this.billItemLIsts = { …this.billItemLIstsOriginal }
forEach 用 break和return false都是无用的。break会报错
那怎么办?就是用try-catch
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
try { var array = ["first","second","third","fourth"]; // 执行到第3次,结束循环 array.forEach(function(item,index){ if (item == "third") { throw new Error("EndIterative"); } alert(item);// first,sencond }); } catch(e) { if(e.message!="EndIterative") throw e; }; // 下面的代码不影响继续执行 alert(10); |
找到: vue.config.js
文件
1 2 3 4 5 |
module.exports = { devServer: { https: true } } |
在vue中的scss中去掉scoped 就可以修改样式了
有时你可能复制项目到另一个机器开发,但是你发现运行npm run 出现问题。
其实很简单
我们删除\node_modules下的所有文件。运行
1 2 |
npm install npm run serve |
OK,问题已解决
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
function foo(args1, args2, retry) { return new Promise(function(resolve, reject) { if (retry <= 0) reject(); var isDone = callAnotherFunction(args1, args2); if(!isDone) { setInterval(function() { retry = retry - 1; isDone = callAnotherFunction(args1, args2); if (isDone) resolve(); }, 2000); } else resolve(); } } function useIt(args1, args2) { // Other code let store = function() { foo(args1, args2, 5).then(result => { cleanStorage(args1, args2); return; } } } |
1 2 3 |
<audio src="/i/horse.ogg" controls="controls" controlsList="nodownload" oncontextmenu="return false"> Your browser does not support the audio element. </audio> |
1 |
<audio ref="audio" autoplay controls src=""> </audio> |
播放当前时间:
1 |
let currentaduioduration = this.$refs.audio.duration //获取视频的总时长 |