# 【按钮异步操作】应用示例

# 举个例子:表格中的按钮异步操作场景

点击上架按钮调用接口更新数据。

点击下架按钮,二次提示“你确定要下架吗?”,点击确定调用接口更新数据,点击取消关闭弹窗。

# 实战开发

上架 下架

按钮异步操作场景代码

<template>
  <div>
    <bst-button type="text" textColor="green" :ajax="{method:'get',url:'/element-ui-best-doc/mock/update.json',params:{id:123}}">上架</bst-button>
    <bst-button type="text" textColor="red" :ajax="{method:'get',url:'/element-ui-best-doc/mock/update.json',params:{id:123}}" twiceHint :hintText="'您确定要下架吗?'">下架</bst-button>
  </div>
</template>
显示代码