element判斷按鈕的禁用條件

2021-10-12 12:45:31 字數 1526 閱讀 1010

根據某個引數,動態的改變某個按鈕的禁用狀態

1.:disabled=「scope.row.userid==1?true:false」

根據登入的使用者id判斷選擇的按鈕是否禁用狀態

實際應用場景:登入使用者為系統管理員時只能修改密碼

貼**

"scope"

>

.native

.prevent=

"look(scope.row)" v-show=

"menulook" type=

"success" size=

"mini"

>檢視<

/el-button>

.native

.prevent=

"edit(scope.row)" v-show=

"menuedit" type=

"warning" size=

"mini"

:disabled=

"scope.row.userid==1?true:false"

>編輯<

/el-button>

<

!--v-if=

"scope.row.userid=='1'"

:disabled=

'disabled'

-->

.native

.prevent=

"del(scope.row)" v-show=

"menuremove" type=

"danger" size=

"mini"

:disabled=

"scope.row.userid==1?true:false"

>刪除<

/el-button>

.native

.prevent=

"stopuse(scope.row)" v-show=

"menustop" type=

"info" v-if=

"scope.row.status==1" size=

"mini"

>啟用<

/el-button>

.native

.prevent=

"stopuse(scope.row)" v-show=

"menustop" type=

"info" v-if=

"scope.row.status==0" size=

"mini"

:disabled=

"scope.row.userid==1?true:false"

>停用<

/el-button>

.native

.prevent=

"plresetpwdpage(scope.row)" v-show=

"menuresetpwd" type=

"warning" size=

"mini"

>重置密碼<

/el-button>

<

/template>

禁用窗體的關閉按鈕

dllimport user32.dll public static extern int getsystemmenu int hwnd,int brevert dllimport user32.dll public static extern int removemenu int hmenu,in...

頁面按鈕禁用與解除禁用的方法

計時器和延時器的概念 計時器 計時器id號 setinterval 函式,毫秒數 每隔指定毫秒數,呼叫一次 函式 clearinterval 計時器id號 停止指定id號的計時器 實際上是銷毀釋放資源了 延時器 延時器id號 settimeout 函式,毫秒間隔 從呼叫開始,等待指定毫秒數後呼叫一次...

禁用瀏覽器的後退按鈕

禁用瀏覽器的後退按鈕 瀏覽器的後退按鈕使得我們能夠方便地返回以前訪問過的頁面,它無疑非常有用。但有時候我們不得不關閉這個功能,以防止使用者打亂預定的頁面訪問次序。本文介紹網路上可找到的各種禁用瀏覽器後退按鈕方案,分析它們各自的優缺點和適用場合。一 概述 曾經有許多人問起,怎樣才能 禁用 瀏覽器的後退...