CabinX全局对象上挂载了notice函数,调用方式:CabinX.notice({...}),具体配置参考Attributes。
示例
PCPhonePad
<page class="demo-box">
<x-button text="默认提示" @click="openNoticeNormal" />
<x-button text="成功提示" @click="openNoticeSuccess" />
<x-button text="警告提示" @click="openNoticeWarning" />
<x-button text="错误提示" @click="openNoticeError" />
</page>
export default XPage({
components: {},
data: {},
openNoticeNormal() {
CabinX.notice({
text: '这是提示这是提示\n这是提示这是提示'
});
},
openNoticeSuccess() {
CabinX.notice({
text: '这是提示这是提示\n这是提示这是提示',
status: 'success'
});
},
openNoticeWarning() {
CabinX.notice({
text: '这是提示这是提示这\n是提示这是提示',
status: 'warning'
});
},
openNoticeError() {
CabinX.notice({
text: '这是提示这是提示这是\n提示这是提示',
status: 'error'
});
},
});
Attributes
参数 | 说明 | 类型 | 可选值 | 默认值 | 端 | 版本 |
---|---|---|---|---|---|---|
text | 提示文案 | Strng | -- | -- | PC/Mobile | -- |
status | 状态 | Strng | success / warning / error | -- | PC/Mobile | -- |
type | 指定枚举类型,用户自定义,相同type同时触发只显示一个 | Strng | -- | -- | PC/Mobile | -- |