跳到主要内容
Notice
用于在页面的顶部显示一些简短的反馈信息,比如操作成功或失败,通常会在几秒钟后自动消失。

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状态Strngsuccess / warning / error--PC/Mobile--
type指定枚举类型,用户自定义,相同type同时触发只显示一个Strng----PC/Mobile--