Refactor post and sheet control button.

pull/9/head
ruibaby 2019-04-24 23:22:56 +08:00
parent c25508e2bb
commit 00c075b8e4
2 changed files with 30 additions and 2 deletions

View File

@ -141,11 +141,23 @@
<a
href="javascript:;"
@click="onEditClick(post)"
v-if="post.status === 'PUBLISHED' || post.status === 'DRAFT'"
>编辑</a>
<a
href="javascript:;"
@click="onEditClick(post)"
v-if="post.status === 'RECYCLE'"
>还原</a>
<a-divider type="vertical" />
<a
href="javascript:;"
@click="deletePost(post.id)"
v-if="post.status === 'PUBLISHED' || post.status === 'DRAFT'"
>回收站</a>
<a
href="javascript:;"
@click="deletePost(post.id)"
v-else-if="post.status === 'RECYCLE'"
>删除</a>
</span>
</a-table>

View File

@ -99,9 +99,25 @@
slot="action"
slot-scope="text, sheet"
>
<a href="javascript:;" @click="onEditClick(sheet)"></a>
<a
href="javascript:;"
@click="onEditClick(sheet)"
v-if="sheet.status === 'PUBLISHED' || sheet.status === 'DRAFT'"
>编辑</a>
<a
href="javascript:;"
@click="onEditClick(sheet)"
v-if="sheet.status === 'RECYCLE'"
>还原</a>
<a-divider type="vertical" />
<a href="javascript:;">删除</a>
<a
href="javascript:;"
v-if="sheet.status === 'PUBLISHED' || sheet.status === 'DRAFT'"
>回收站</a>
<a
href="javascript:;"
v-else-if="sheet.status === 'RECYCLE'"
>删除</a>
</span>
</a-table>
</a-tab-pane>