vue computed pass params All In One
vue computed pass params All In One
vue computed pass parameter
js clousure
js 闭包
<template>
<section class="vertical-video-9vs16-container">
<!-- 多组创意文案-->
<el-form-item>
<div slot="label">
<span class="c-red">* </span>创意文案
</div>
<section class="text-add-group-container">
<section
class="text-add-group-boxs"
v-for="(item, index) in textGroupList"
:key="(index)">
<div class="text-add-group-box">
<el-form-item
label=""
:prop="`creativeList.${creativeIndex}.descList.${index}`"
:rules="[
{
required: true,
validator: descListValidator,
trigger: 'blur',
},
]">
<CreativeTexts
ref="creativeTextsRef"
:titleIndex="index"
titleType="descList"
:creativeObj="creativeObj"
:customWords="customWords"
:sensitiveList="sensitiveList"
:prohibitedList="prohibitedList"
@validate-field="validateFieldByKey"
@open-title-type="openTitleLibraryModal('descList', index)"
/>
</el-form-item>
<div
v-if="textGroupList.length > 1"
class="delete-icon-box">
<div>
<icon-svg
icon-class="delete"
class="delete-icon"
@click="removeDescGroup(index)"
/>
</div>
</div>
</div>
<el-form-item
v-if="isShowDescListSensitives(index)"
class="creative-text-input-warning-box"
label="">
<div class="creative-text-input-warning">
<el-alert
type="warning"
:closable="false"
:title="`包含敏感词:${getDescListSensitives(index)}`">
</el-alert>
</div>
</el-form-item>
</section>
<div
v-if="leftNum > 0"
class="add-group-btn-box"
@click="addDescGroup">
<span class="add-group-btn-text">
<icon-svg icon-class="tianjia1" />
<span>还可以添加{{leftNum}}组</span>
</span>
</div>
</section>
</el-form-item>
</section>
</template>
export default {
name: 'VerticalVideo9vs16',
computed: {
isShowTitleListSensitives () {
return this.creativeObj.titleList[0].sensitiveList.length > 0;
},
isShowDescListSensitives () {
// ES5 Function ✅ this
return function (index) {
return this.creativeObj.descList[index].sensitiveList.length > 0;
};
// ES6 Arrow Function ??? this bug ❌
return (index) => {
return this.creativeObj.descList[index].sensitiveList.length > 0;
};
},
},,
mounted () {
this.init();
},
methods: {
init () {
//
},
},
};
computed: {
fullName() {
return salut => `${salut} ${this.firstName} ${this.lastName}`
}
}
refs
https://stackoverflow.com/questions/40522634/can-i-pass-parameters-in-computed-properties-in-vue-js
©xgqfrms 2012-2020
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/15134843.html
未经授权禁止转载,违者必究!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)
2020-08-12 wifi IP address scanner on macOS All In One
2020-08-12 算法的时间复杂度 & 性能对比
2020-08-12 STAR 法则
2020-08-12 高级数据结构之 BloomFilter All In One
2020-08-12 Webpack 4.x 默认支持 ES6 语法
2019-08-12 2019 front-end job Interview
2019-08-12 js currying All In One