ActionSheet

操作表,从屏幕下方移入。Demo

引入

import { ActionSheet } from 'vue-pmui';
// 全局使用
Vue.component(ActionSheet.name, ActionSheet);
// 或者
Vue.use(ActionSheet);

例子

<pm-button @click="pick"> ActionSheet </pm-button>
<!-- ActionSheet -->
<pm-action-sheet
  ref="sheet"
  :actions="actions">
</pm-action-sheet>
export default {
    data() {
      return {
        actions: [
          {
            title: '士多啤梨',
            callback: () => this.$dialog('士多啤梨')
          },
          {
            title: '苹果',
            highlight: true,
            callback: () => this.$toast('苹果')
          },
          {
            title: '橙',
            callback: () => alert('orange')
          }
        ]
      };
    },
    methods: {
      pick() {
        this.$refs.sheet.show();
      }
    }
  };

Props

参数 说明 类型 可选值 默认值
showCancel 是否显示取消选项 Boolean true
cancelText 取消选项文本 String 取消
actions 选项 Array []

actions

参数 说明 类型 可选值 默认值
title 选项标题 String
highlight 是否高亮选项 Boolean false
callback 选中选项时的回调函数 Function function({ action, index })

Methods

方法名 说明 参数
show 显示
hide 隐藏

results matching ""

    No results matching ""