# message 弹窗JS组件 Beta

# 示例

示例请看 src/demos/dialog.vue

# Options

下面的参数为使用JS方式调用时常用的参数,如果需要控制其他参数,请分别查阅: 反馈式弹窗 操作式弹窗

参数 必填 说明 类型 可选值 默认值
customerClass 公共类名 string —— ——
desc 描述信息 string/object(Component) —— ——
widget content slot 传入的组件 object(Component) —— ——
footerBtnStyle footer 按钮样式 string/object —— ——
size 尺寸 string medium/large medium
isJSVersion 是否是JS版本,组件方式使用时不需要传递 boolean true/false false
showCancelButton 是否显示取消按钮 boolean true/false false
showFooter 是否显示footer boolean true/false true
showSuccessIcon 是否显示成功图标 boolean true/false false
showWarningIcon 是否显示告警图标 boolean true/false false
showErrorIcon 是否显示错误图标 boolean true/false false
showTitle 是否显示标题 boolean true/false true
customerWidth 是否设置自定义宽度 string —— ——
title 标题 string —— 默认标题
cancelBtnTxt 取消按钮文本 string —— ——
confirmBtnTxt 确认按钮文本 string —— ——
onClose 关闭前的钩子函数 function —— ——
onCancel 取消前钩子函数 function —— ——
onConfirm 确认前钩子函数 function —— ——
descData 【js调用】:desc 是 Component ,需要传递参数时 object —— ——
widgetData 【js调用】:widget 是 Component ,需要传递参数时 object —— ——
  • descData,widgetData 数据结构明细:
{
  // Same API as `v-bind:class`, accepting either
  // a string, object, or array of strings and objects.
  class: {
    foo: true,
    bar: false
  },
  // Same API as `v-bind:style`, accepting either
  // a string, object, or array of objects.
  style: {
    color: 'red',
    fontSize: '14px'
  },
  // Normal HTML attributes
  attrs: {
    id: 'foo'
  },
  // Component props
  props: {
    myProp: 'bar'
  },
  // DOM properties
  domProps: {
    innerHTML: 'baz'
  },
  // Event handlers are nested under `on`, though
  // modifiers such as in `v-on:keyup.enter` are not
  // supported. You'll have to manually check the
  // keyCode in the handler instead.
  on: {
    click: this.clickHandler
  },
  // For components only. Allows you to listen to
  // native events, rather than events emitted from
  // the component using `vm.$emit`.
  nativeOn: {
    click: this.nativeClickHandler
  },
  // Custom directives. Note that the `binding`'s
  // `oldValue` cannot be set, as Vue keeps track
  // of it for you.
  directives: [
    {
      name: 'my-custom-directive',
      value: '2',
      expression: '1 + 1',
      arg: 'foo',
      modifiers: {
        bar: true
      }
    }
  ],
  // Scoped slots in the form of
  // { name: props => VNode | Array<VNode> }
  scopedSlots: {
    default: props => createElement('span', props.text)
  },
  // The name of the slot, if this component is the
  // child of another component
  slot: 'name-of-slot',
  // Other special top-level properties
  key: 'myKey',
  ref: 'myRef',
  // If you are applying the same ref name to multiple
  // elements in the render function. This will make `$refs.myRef` become an
  // array
  refInFor: true
}
Last Updated: 2021/10/29 下午4:12:51