sybz-components 0.0.2

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 刘力豪
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,48 @@
1
+ # element-plus二次封装
2
+
3
+ 使用vue3+element-plus封装前端组件。以利于前端组件化和工程化开发
4
+
5
+ ## 1. 组件的使用
6
+
7
+ ### 在vue3项目的main.js里引入
8
+
9
+ ```js
10
+ import 'sybz-components/style.css'
11
+ import SybzComponents from 'sybz-components'
12
+ app.use(SybzComponents)
13
+ ```
14
+
15
+ ### 在任何一个.vue文件下, 可直接引入组件
16
+
17
+ ```js
18
+ <s-button>这是s-button</s-button>
19
+ <s-title title="这是s-title"></s-title>
20
+ ```
21
+
22
+ ## 2. 在vue3项目中使用公共函数, 安装@sybz-components/utils
23
+
24
+ ```js
25
+ // 如果想将所有函数挂载至全局使用
26
+ import * as utils from '@sybz-components/utils'
27
+ // 将sybz-components下的公共函数赋值到全局
28
+ Object.keys(utils).forEach((v) => {
29
+ app.config.globalProperties[v] = utils[v]
30
+ })
31
+ 然后通过`proxy.$toast('哈哈')`, 这种方式去使用函数
32
+
33
+ // 如果想单独的引用某个函数
34
+ import { $toast } from '@sybz-components/utils'
35
+ $toast('嘿嘿')
36
+ ```
37
+
38
+ ## 3. 在vue3项目中使用自定义指令
39
+
40
+ 当前项目支持的自定义指令有以下
41
+
42
+ ```
43
+ v-copy
44
+ v-number
45
+ v-focus
46
+ ```
47
+
48
+ 更多内容请查看[文档](https://liulihao88.github.io/sybz-components/)