little-dizzy 2.1.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,16 +7,18 @@
7
7
  import buttonSnippet from './button.js'
8
8
  import cardSnippet from './card.js'
9
9
  import modalSnippet from './modal.js'
10
+ import messageSnippet from './message.js'
10
11
 
11
12
  // 所有预设代码片段
12
13
  export const presetSnippets = [
13
14
  buttonSnippet,
14
15
  cardSnippet,
15
- modalSnippet
16
+ modalSnippet,
17
+ messageSnippet
16
18
  ]
17
19
 
18
20
  // 单独导出
19
- export { buttonSnippet, cardSnippet, modalSnippet }
21
+ export { buttonSnippet, cardSnippet, modalSnippet, messageSnippet }
20
22
 
21
23
  export default presetSnippets
22
24
 
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Message 消息提示组件示例代码
3
+ */
4
+ export default {
5
+ name: 'Message',
6
+ type: 'vue',
7
+ label: 'Message 消息提示',
8
+ code: `<template>
9
+ <div class="message-demo">
10
+ <Button type="success" @click="showSuccess">成功提示</Button>
11
+ <Button type="warning" @click="showWarning">警告提示</Button>
12
+ <Button type="danger" @click="showError">错误提示</Button>
13
+ <Button type="info" @click="showInfo">信息提示</Button>
14
+ </div>
15
+ </template>
16
+
17
+ <script setup>
18
+ import { Button, message } from 'little-dizzy'
19
+
20
+ const showSuccess = () => {
21
+ message.success('操作成功!')
22
+ }
23
+
24
+ const showWarning = () => {
25
+ message.warning('请注意!')
26
+ }
27
+
28
+ const showError = () => {
29
+ message.error('操作失败!')
30
+ }
31
+
32
+ const showInfo = () => {
33
+ message.info('这是一条提示信息', { duration: 5000, closable: true })
34
+ }
35
+ </script>
36
+
37
+ <style scoped>
38
+ .message-demo {
39
+ display: flex;
40
+ gap: 12px;
41
+ flex-wrap: wrap;
42
+ }
43
+ </style>`
44
+ }
45
+
@@ -34,6 +34,14 @@ $shadow-lg: 0 6px 20px rgba(0, 0, 0, 0.2);
34
34
  margin: 0;
35
35
  padding: 0;
36
36
  box-sizing: border-box;
37
+
38
+ // 隐藏滚动条(保持滚动功能)
39
+ scrollbar-width: none; // Firefox
40
+ -ms-overflow-style: none; // IE/Edge
41
+
42
+ &::-webkit-scrollbar {
43
+ display: none; // Chrome/Safari/Opera
44
+ }
37
45
  }
38
46
 
39
47
  body {
@@ -0,0 +1 @@
1
+ @import "tailwindcss";