77 <Preview :component =" MessagePreview2" />
88 <Preview :component =" MessagePreview3" />
99 <Preview :component =" MessagePreview4" />
10+ <Doc title =" 配置项" type =" prop" :body =" propDoc" />
11+ <Doc title =" 方法" type =" methods" :body =" methodsDoc" />
12+ <PrevAndNext
13+ :prev =" { path: '/doc/dialog', name: 'Dialog 对话框' }"
14+ :next =" { path: '/doc/Affix', name: '固钉 Affix' }"
15+ />
1016 </div >
1117 </div >
1218</template >
@@ -17,6 +23,39 @@ import MessagePreview1 from "./MessagePreview1.preview.vue";
1723import MessagePreview2 from " ./MessagePreview2.preview.vue" ;
1824import MessagePreview3 from " ./MessagePreview3.preview.vue" ;
1925import MessagePreview4 from " ./MessagePreview4.preview.vue" ;
26+ import PrevAndNext from " @/components/PrevAndNext.vue" ;
27+ import Doc from " @/components/Doc.vue" ;
28+
29+ const propDoc = [
30+ [" message" , " 消息文字" , " string / VNode" , " -" , " -" ],
31+ [" type" , " 消息类型" , " string" , " success / warning / info / error" , " info" ],
32+ [
33+ " duration" ,
34+ " 显示时间,单位为毫秒。 设为 0 则不会自动关闭" ,
35+ " number" ,
36+ " -" ,
37+ " 3000" ,
38+ ],
39+ [" show-close" , " 是否显示关闭按钮" , " boolean" , " -" , " false" ],
40+ [" center" , " 文字是否居中" , " boolean" , " -" , " false" ],
41+ [
42+ " on-close" ,
43+ " 关闭时的回调函数, 参数为被关闭的 message 实例" ,
44+ " function" ,
45+ " -" ,
46+ " -" ,
47+ ],
48+ [" offset" , " Message 距离窗口顶部的偏移量" , " number" , " -" , " 20" ],
49+ [
50+ " appendTo" ,
51+ " 设置组件的根元素" ,
52+ " string / HTMLElement" ,
53+ " -" ,
54+ " document.body" ,
55+ ],
56+ ];
57+
58+ const methodsDoc = [[" close" , " 关闭当前的 Message" , " -" ]];
2059 </script >
2160
2261<style lang="scss">
0 commit comments