el-button根据条件更换图标、文字、是否禁用

vue el-button根据条件更换图标、文字、是否禁用

<template #default="scope">
<el-button :icon=" scope.row.isPublished ? 'ele-Document' : 'ele-Position'" size="small" text type="primary" @click="handlePublish(scope.row)" v-auth="'trainSchedule:update'" :disabled="scope.row.isPublished">
 {{scope.row.isPublished ? "已发布" : "发布"}} 
el-button>
template>

你可能感兴趣的:(javascript,前端,vue.js)