byt-ui 0.0.7 → 0.0.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "byt-ui",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "private": false,
5
5
  "description": "byt组件库",
6
6
  "author": {
@@ -16,9 +16,9 @@
16
16
  },
17
17
  "main": "lib/byt-ui.umd.min.js",
18
18
  "dependencies": {
19
- "byt-ui": "^0.0.5",
20
19
  "core-js": "^3.8.3",
21
20
  "element-ui": "^2.15.10",
21
+ "js-cookie": "^3.0.1",
22
22
  "moment": "^2.29.4",
23
23
  "vue": "^2.6.14",
24
24
  "vxe-table": "^3.6.6",
@@ -30,6 +30,7 @@
30
30
  "@vue/cli-plugin-babel": "~5.0.0",
31
31
  "@vue/cli-plugin-eslint": "~5.0.0",
32
32
  "@vue/cli-service": "~5.0.0",
33
+ "babel-plugin-component": "^1.1.1",
33
34
  "eslint": "^7.32.0",
34
35
  "eslint-plugin-vue": "^8.0.3",
35
36
  "node-sass": "4.14.1",
@@ -2,7 +2,7 @@
2
2
  * @Description:
3
3
  * @Author: 王国火
4
4
  * @Date: 2022-09-19 10:17:14
5
- * @LastEditTime: 2022-10-08 10:50:57
5
+ * @LastEditTime: 2022-10-17 11:11:54
6
6
  * @LastEditors: 王国火
7
7
  */
8
8
  // 动态引入
@@ -12,8 +12,6 @@ requireContext.keys().map(key => {
12
12
  const reg=/\w+/
13
13
  const k=key.match(reg)[0]
14
14
  conmmon[k]=requireContext(key).default||requireContext(key)
15
+ //conmmon=Object.assign(conmmon,requireContext(key).default||requireContext(key))
15
16
  })
16
-
17
- console.log(conmmon)
18
-
19
17
  export default conmmon
@@ -0,0 +1,33 @@
1
+ /*
2
+ * @Description:
3
+ * @Author: 王国火
4
+ * @Date: 2022-10-18 12:37:03
5
+ * @LastEditTime: 2022-10-18 12:37:56
6
+ * @LastEditors: 王国火
7
+ */
8
+ import Cookie from 'js-cookie'
9
+ import website from './website'
10
+ export const getCookie = (key, context) => {
11
+ const searchKey = `${website.key}_${key}`
12
+ if (context && context.req) {
13
+ if (context.req.headers.cookie) {
14
+ const arr = context.req.headers.cookie.split(';')
15
+ const cookie = arr.find((item) => {
16
+ return (item.split('=')[0]).trim() === searchKey
17
+ })
18
+ return cookie ? cookie.split('=')[1] : ''
19
+ } else {
20
+ return ''
21
+ }
22
+ } else {
23
+ return Cookie.get(searchKey) ? Cookie.get(searchKey) : ''
24
+ }
25
+ }
26
+
27
+ export const setCookie = (key, value, expires = 7, path = '/') => {
28
+ return Cookie.set(`${website.key}_${key}`, value, { expires, path })
29
+ }
30
+
31
+ export const removeCookie = (key, path = '/') => {
32
+ return Cookie.remove(key, { path })
33
+ }
@@ -2,7 +2,7 @@
2
2
  * @Description:
3
3
  * @Author: 王国火
4
4
  * @Date: 2022-07-12 17:47:20
5
- * @LastEditTime: 2022-09-19 10:23:41
5
+ * @LastEditTime: 2022-10-08 15:57:54
6
6
  * @LastEditors: 王国火
7
7
  -->
8
8
 
@@ -126,7 +126,7 @@ import FormView from '../form-view/index.vue'
126
126
  * @see {@link https://element.eleme.cn/#/zh-CN/component/installation}
127
127
  */
128
128
  export default {
129
- name: 'BaseView',
129
+ name: 'BytBaseView',
130
130
  props: {
131
131
  /** 搜索行内表单配置*/
132
132
  searchList: {
@@ -2,7 +2,7 @@
2
2
  * @Description:
3
3
  * @Author: 王国火
4
4
  * @Date: 2022-07-13 08:46:34
5
- * @LastEditTime: 2022-09-15 10:08:10
5
+ * @LastEditTime: 2022-10-08 15:58:01
6
6
  * @LastEditors: 王国火
7
7
  -->
8
8
  <!-- -->
@@ -76,7 +76,7 @@ import moment from 'moment'
76
76
  * @displayName FormView
77
77
  */
78
78
  export default {
79
- name: 'FormView',
79
+ name: 'BytFormView',
80
80
  props: {
81
81
  inline: {
82
82
  type: Boolean,
package/packages/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * @Description:
3
3
  * @Author: 王国火
4
4
  * @Date: 2022-09-15 17:02:55
5
- * @LastEditTime: 2022-10-08 10:52:11
5
+ * @LastEditTime: 2022-10-18 12:39:29
6
6
  * @LastEditors: 王国火
7
7
  */
8
8
  import Vue from 'vue'
@@ -23,6 +23,11 @@ Vue.use(ElementUI, {
23
23
  menuType: 'text'
24
24
  })
25
25
 
26
+ const Cmps={}
27
+ components.map(component => {
28
+ Cmps[component.name]=component
29
+ })
30
+
26
31
 
27
32
  // install组件api
28
33
  const install = function (Vue) {
@@ -34,9 +39,12 @@ const install = function (Vue) {
34
39
 
35
40
 
36
41
  export default{
37
- install
42
+ install,
43
+ ...Cmps,
44
+ ...Common
38
45
  }
39
46
 
47
+ export const cookie=Common.cookie
40
48
  export const store=Common.store
41
49
  export const validate=Common.validate
42
50
  export const website=Common.website