<a-select-option @click="showDrawer" :value="auth === 0? item.project_id :item.id" v-for="(item) in prolist" :key="item.id" >
上面这种 :value是动态传值 
"auth === 0? item.project_id :item.id"   这个是js的if 表达式(简写)
 
比如控制按钮是否展示 <a-button type="primary" @click="groupapi(value),onClose()" v-bind:disabled="prolist.length===0? true:false">确定</a-button>
 另外一种 写法 https://www.cnblogs.com/kaibindirver/p/12601575.html
 
tags === '正常' ? 'green' : tags.length > 2 ? 'orange' : 'red'     //tags等于正常 那么绿色,不等于正常 再判断长度是否大于2,大于为橙色,小于为红色
 
 
const commonHeaders = (token) =>{
const headers = {
Authorization:token || null
}}
 
|| 为或的意思 当token为空(没有赋值) 那么就赋值null
遇到不懂的记录

 

https://es6.ruanyifeng.com/#docs/function 

相关文章:

  • 2021-09-29
  • 2021-07-08
  • 2021-09-25
  • 2021-12-26
  • 2022-01-06
  • 2021-05-21
  • 2022-12-23
猜你喜欢
  • 2021-06-21
  • 2021-09-19
  • 2022-03-03
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2021-09-03
相关资源
相似解决方案