# message 弹窗JS组件 Beta
# 示例
示例请看 src/demos/dialog.vue
# Options
参数 | 必填 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|---|
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
}