renusify 1.0.3 → 1.0.4

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.
Files changed (36) hide show
  1. package/LICENSE +1 -1
  2. package/components/button/buttonGroup.vue +0 -4
  3. package/components/button/index.vue +0 -2
  4. package/components/card/index.vue +0 -2
  5. package/components/chat/MessageList.vue +0 -2
  6. package/components/chat/chatMsg.vue +4 -4
  7. package/components/form/colorPicker/Alpha.vue +26 -45
  8. package/components/form/colorPicker/Hue.vue +32 -51
  9. package/components/form/colorPicker/Preview.vue +21 -28
  10. package/components/form/colorPicker/Saturation.vue +49 -69
  11. package/components/form/colorPicker/index.vue +53 -38
  12. package/components/form/colorPicker/mixin.js +6 -1
  13. package/components/form/colorPicker/picker.vue +80 -39
  14. package/components/form/group-input.vue +122 -105
  15. package/components/form/inputTel/index.vue +8 -10
  16. package/components/form/json/JsonView.vue +15 -11
  17. package/components/form/json/index.vue +29 -10
  18. package/components/form/mask-input.vue +0 -5
  19. package/components/form/range.vue +0 -2
  20. package/components/form/select.vue +14 -14
  21. package/components/iframe/index.vue +60 -38
  22. package/components/index.js +91 -85
  23. package/components/infinite/div.vue +2 -3
  24. package/components/infinite/page.vue +2 -3
  25. package/components/list/index.vue +0 -2
  26. package/components/menu/index.vue +2 -5
  27. package/components/searchBox/index.vue +0 -4
  28. package/components/slider/index.vue +0 -4
  29. package/components/swiper/index.vue +0 -4
  30. package/components/table/index.vue +0 -4
  31. package/directive/index.js +18 -19
  32. package/directive/touch/index.js +31 -18
  33. package/index.js +9 -2
  34. package/package.json +1 -1
  35. package/tools/helper.js +23 -0
  36. package/components/form/colorPicker/Box.vue +0 -85
@@ -3,7 +3,7 @@
3
3
  <r-input :active="active"
4
4
  v-bind="$attrs"
5
5
  :readonly="readonly"
6
- :modelValue="$helper.ifHas(chips,null,0,'value')"
6
+ :modelValue="$helper.ifHas(chips,null,0,value)"
7
7
  @click.prevent="handleClick()">
8
8
  <div class="select-wrap v-center"
9
9
  :class="{'flex-nowrap':!multiple}">
@@ -49,7 +49,7 @@
49
49
  checked>
50
50
  <template v-slot="props">
51
51
  <slot :item="props.item">
52
- <div class="list-title" role="option">
52
+ <div class="list-title">
53
53
  {{ props.item[text] }}
54
54
  </div>
55
55
  </slot>
@@ -66,14 +66,10 @@
66
66
  </template>
67
67
  <script>
68
68
  import './scss/select.scss'
69
- import clickOutside from '../../directive/clickOutSide/index'
70
69
 
71
70
  export default {
72
71
  name: 'r-select',
73
72
  inheritAttrs: false,
74
- directives: {
75
- 'click-outside': clickOutside
76
- },
77
73
  props: {
78
74
  searchLink: String,
79
75
  type: {
@@ -84,6 +80,10 @@ export default {
84
80
  type: String,
85
81
  default: 'name'
86
82
  },
83
+ value: {
84
+ type: String,
85
+ default: 'value'
86
+ },
87
87
  combo: Boolean,
88
88
  readonly: Boolean,
89
89
  textChip: Boolean,
@@ -132,7 +132,7 @@ export default {
132
132
  if (this.$helper.hasKey(res, i)) {
133
133
  let v = {}
134
134
  v[this.text] = res[i].toString()
135
- v['value'] = res[i]
135
+ v[this.value] = res[i]
136
136
  res[i] = v
137
137
  }
138
138
  }
@@ -178,22 +178,22 @@ export default {
178
178
  if (this.$helper.ifHas(this.modelValue, false, this.text)) {
179
179
  return [this.modelValue]
180
180
  } else if (typeof this.modelValue === 'string' || typeof this.modelValue === 'number') {
181
- const index = this.$helper.searchArray(this.genItems, 'value', this.modelValue)
181
+ const index = this.$helper.searchArray(this.genItems, this.value, this.modelValue)
182
182
  if (index !== false) {
183
183
  return [this.genItems[index]]
184
184
  }
185
185
  return [{
186
- [this.text]: this.modelValue.toString(), value: this.modelValue
186
+ [this.text]: this.modelValue.toString(), [this.value]: this.modelValue
187
187
  }]
188
188
  } else if (typeof this.modelValue[0] === 'string' || typeof this.modelValue[0] === 'number') {
189
189
  let res = []
190
190
  const lng = this.modelValue.length
191
191
  for (let i = 0; i < lng; i++) {
192
- const index = this.$helper.searchArray(this.genItems, 'value', this.modelValue[i])
192
+ const index = this.$helper.searchArray(this.genItems, this.value, this.modelValue[i])
193
193
  if (index !== false) {
194
194
  res.push(this.genItems[index])
195
195
  } else {
196
- res.push({[this.text]: this.modelValue[i].toString(), value: this.modelValue[i]})
196
+ res.push({[this.text]: this.modelValue[i].toString(), [this.value]: this.modelValue[i]})
197
197
  }
198
198
  }
199
199
  return res
@@ -220,7 +220,7 @@ export default {
220
220
  },
221
221
  add() {
222
222
  if (this.inputVal) {
223
- let val = {[this.text]: this.inputVal.toString(), value: this.inputVal}
223
+ let val = {[this.text]: this.inputVal.toString(), [this.value]: this.inputVal}
224
224
  if (!this.multiple) {
225
225
  this.chips = []
226
226
  }
@@ -246,7 +246,7 @@ export default {
246
246
  val = []
247
247
  for (let i in this.chips) {
248
248
  if (this.$helper.hasKey(this.chips, i)) {
249
- val.push(this.chips[i]['value'])
249
+ val.push(this.chips[i][this.value])
250
250
  }
251
251
  }
252
252
  }
@@ -254,7 +254,7 @@ export default {
254
254
  val = val[0]
255
255
  if (val) {
256
256
  if (this.justValue) {
257
- val = val['value']
257
+ val = val[this.value]
258
258
  }
259
259
  this.closeList()
260
260
  }
@@ -1,45 +1,67 @@
1
1
  <script>
2
- import {createApp} from 'vue'
3
- export default {
4
- name: 'r-frame',
5
- props: {
6
- head: String
7
- },
8
- render(h) {
9
- return h('iframe', {
10
- on: {load: this.renderChildren}
11
- })
12
- },
13
- beforeUpdate() {
14
- const head = this.$el.contentDocument.head
15
- head.innerHTML = this.head
16
- this.iApp.children = Object.freeze(this.$slots.default)
17
- },
18
- methods: {
19
- renderChildren() {
20
- const children = this.$slots.default
21
- const body = this.$el.contentDocument.body
22
- const el = document.createElement('DIV')
23
- body.appendChild(el)
24
- const iApp = createApp({
25
- name: 'iApp',
26
- data: function () {
27
- return {children: Object.freeze(children)};
28
- },
29
- render(h) {
30
- return h('div', this.children)
31
- }
32
- })
2
+ import {createApp, h} from 'vue'
3
+ import renusify from "renusify";
33
4
 
34
- iApp.$mount(el)
35
-
36
- this.iApp = iApp
37
- }
5
+ export default {
6
+ name: 'r-frame',
7
+ props: {
8
+ head: String,
9
+ plugins: Array,
10
+ renusifyConfig: {
11
+ type: Object,
12
+ default: () => {
13
+ return {
14
+ prefix: "sm-",
15
+ lang: "en",
16
+ package: 'renusify',
17
+ directives: ["title", "scroll"]
38
18
  }
19
+ }
39
20
  }
21
+ },
22
+ render() {
23
+ return h('iframe', {
24
+ onLoad: this.renderChildren
25
+ })
26
+ },
27
+ beforeUpdate() {
28
+ const head = this.$el.contentDocument.head
29
+ head.innerHTML = this.head
30
+ this.iApp.children = this.$slots.default()
31
+ },
32
+ methods: {
33
+ renderChildren() {
34
+ const children = this.$slots.default()
35
+ const head = this.$el.contentDocument.head
36
+ head.innerHTML = this.head
37
+ const body = this.$el.contentDocument.body
38
+ const el = document.createElement('DIV')
39
+ body.appendChild(el)
40
+ const iApp = createApp({
41
+ name: 'iApp',
42
+ data: function () {
43
+ return {children: children};
44
+ },
45
+ render() {
46
+ return h('div', this.children)
47
+ }
48
+ })
49
+ if (this.plugins) {
50
+ this.plugins.forEach((item) => {
51
+ iApp.use(item)
52
+ })
53
+ }
54
+ iApp.use(renusify, this.renusifyConfig)
55
+ iApp.mount(el)
56
+
57
+ this.iApp = iApp
58
+ }
59
+ }
60
+ }
40
61
  </script>
41
62
  <style>
42
- iframe {
43
- width: 100%;
44
- }
63
+ iframe {
64
+ width: 100%;
65
+ height: 100%;
66
+ }
45
67
  </style>
@@ -1,104 +1,110 @@
1
- import {defineAsyncComponent} from "vue";
2
-
3
1
  const list = {
4
- 'r-app': 'app/index.vue',
5
- 'r-content': 'content/index.vue',
6
- 'r-meta': 'meta/index.js',
7
- 'r-container': 'container/index.vue',
8
- 'r-row': 'container/row.vue',
9
- 'r-col': 'container/col.vue',
10
- 'r-spacer': 'container/spacer.vue',
11
- 'r-divider': 'container/divider.vue',
12
- 'r-btn': 'button/index.vue',
13
- 'r-icon': 'icon/index.vue',
14
- 'r-form-creator': 'formCreator/index.vue',
15
- 'r-card': 'card/index.vue',
16
- 'r-modal': 'modal/index.vue',
17
- 'r-form': 'form/form.vue',
18
- 'r-input': 'form/input.vue',
19
- 'r-text-input': 'form/text-input.vue',
20
- 'r-unit-input': 'form/unit-input.vue',
21
- 'r-tel': 'form/inputTel/index.vue',
22
- 'r-switch': 'form/switch.vue',
23
- 'r-checkbox': 'form/checkbox.vue',
24
- 'r-radio-input': 'form/radioInput.vue',
25
- 'r-chip': 'chip/index.vue',
26
- 'r-list': 'list/index.vue',
27
- 'r-table': 'table/index.vue',
28
- 'r-table-crud': 'table/crud/index.vue',
29
- 'r-message': 'message/index.vue',
30
- 'r-time-ago': 'timeAgo/index.vue',
31
- 'r-confirm': 'confirm/index.vue',
32
- 'r-mask-input': 'form/mask-input.vue',
33
- 'r-progress-circular': 'progress/circular.vue',
34
- 'r-progress-liner': 'progress/liner.vue',
35
- 'r-img': 'img/index.vue',
36
- 'r-chart': "chart/chart.vue",
37
- 'r-date-picker': 'form/datePicker/index.vue',
38
- 'r-btn-group': 'button/buttonGroup.vue',
39
- 'r-group-input': "form/group-input.vue",
40
- 'r-text-area': 'form/text-area.vue',
41
- 'r-address': 'form/address.vue',
42
- 'r-check-input': 'form/check-input.vue',
43
- 'r-unique-feild': 'form/uniqueFeild/index.vue',
44
- 'r-file-uploader': 'form/fileUploader/index.vue',
45
- 'r-select': 'form/select.vue',
46
- 'r-range': 'form/range.vue',
47
- 'r-number': 'form/number.vue',
48
- 'r-rating': 'form/rating.vue',
49
- 'r-text-editor': 'form/text-editor/index.vue',
50
- 'r-text-editor-preview': 'form/text-editor/preview.vue',
51
- 'r-avatar': 'avatar/index.vue',
52
- 'r-toolbar': 'bar/toolbar/index.vue',
53
- 'r-bottom-navigation': 'bar/bottomNav.vue',
54
- 'r-bottom-navigation-circle': "bar/bottomNavigationCircle.vue",
55
- 'r-breadcrumbs': 'breadcrumb/index.vue',
56
- 'r-breadcrumbs-item': 'breadcrumb/bredcrumbItem.vue',
57
- 'r-count-down': 'countdown/index.vue',
58
- 'r-slider': 'slider/index.vue',
59
- 'r-swiper': 'swiper/index.vue',
60
- 'r-tabs': 'tabs/index.vue',
61
- 'r-infinite-div': 'infinite/div.vue',
62
- 'r-infinite-page': 'infinite/page.vue',
63
- 'r-infinite-box': 'infinite/index.vue',
64
- 'r-iframe': 'iframe/index.vue',
65
- 'r-menu': 'menu/index.vue',
66
- 'r-tree': 'tree/index.vue',
67
- 'r-tree-element': 'tree/tree-element.vue',
68
- 'r-float': 'float/index.vue',
69
- 'r-timeline': 'timeline/index.vue',
70
- 'r-password': "form/password.vue",
71
- 'r-color-picker': "form/colorPicker/index.vue",
72
- 'r-html2pdf': "html2pdf/index.vue",
73
- 'r-html2pdf-page-break': "html2pdf/pageBreak.vue",
74
- 'r-code-editor': "codeEditor/index.vue",
75
- 'r-map': "map/index.vue",
76
- 'r-map-select': "map/select.vue",
77
- 'r-map-route': "map/route.vue",
78
- 'r-tour': "tour/index.vue",
79
- 'r-chat': "chat/index.vue",
80
- 'r-time-picker': "form/timepicker/index.vue",
81
- 'r-cam-input': "form/camInput",
82
- 'r-json': 'form/json/index.vue',
83
- 'r-calendar': 'calendar/index.vue',
84
- 'r-search-box': 'searchBox/index.vue',
2
+ 'r-app': {'p': 'app/index.vue', 'c': [], 'd': []},
3
+ 'r-content': {'p': 'content/index.vue', 'c': [], 'd': []},
4
+ 'r-meta': {'p': 'meta/index.js', 'c': [], 'd': []},
5
+ 'r-container': {'p': 'container/index.vue', 'c': [], 'd': []},
6
+ 'r-row': {'p': 'container/row.vue', 'c': [], 'd': []},
7
+ 'r-col': {'p': 'container/col.vue', 'c': [], 'd': []},
8
+ 'r-spacer': {'p': 'container/spacer.vue', 'c': [], 'd': []},
9
+ 'r-divider': {'p': 'container/divider.vue', 'c': [], 'd': []},
10
+ 'r-btn': {'p': 'button/index.vue', 'c': [], 'd': ['ripple']},
11
+ 'r-icon': {'p': 'icon/index.vue', 'c': [], 'd': []},
12
+ 'r-form-creator': {'p': 'formCreator/index.vue', 'c': [], 'd': []},
13
+ 'r-card': {'p': 'card/index.vue', 'c': [], 'd': ['ripple']},
14
+ 'r-modal': {'p': 'modal/index.vue', 'c': [], 'd': []},
15
+ 'r-form': {'p': 'form/form.vue', 'c': [], 'd': []},
16
+ 'r-input': {'p': 'form/input.vue', 'c': [], 'd': []},
17
+ 'r-text-input': {'p': 'form/text-input.vue', 'c': [], 'd': []},
18
+ 'r-unit-input': {'p': 'form/unit-input.vue', 'c': [], 'd': []},
19
+ 'r-tel': {'p': 'form/inputTel/index.vue', 'c': [], 'd': []},
20
+ 'r-switch': {'p': 'form/switch.vue', 'c': [], 'd': []},
21
+ 'r-checkbox': {'p': 'form/checkbox.vue', 'c': [], 'd': []},
22
+ 'r-radio-input': {'p': 'form/radioInput.vue', 'c': [], 'd': []},
23
+ 'r-chip': {'p': 'chip/index.vue', 'c': [], 'd': []},
24
+ 'r-list': {'p': 'list/index.vue', 'c': [], 'd': ['ripple']},
25
+ 'r-table': {'p': 'table/index.vue', 'c': [], 'd': ['sortable']},
26
+ 'r-table-crud': {'p': 'table/crud/index.vue', 'c': [], 'd': []},
27
+ 'r-message': {'p': 'message/index.vue', 'c': [], 'd': []},
28
+ 'r-time-ago': {'p': 'timeAgo/index.vue', 'c': [], 'd': []},
29
+ 'r-confirm': {'p': 'confirm/index.vue', 'c': [], 'd': []},
30
+ 'r-mask-input': {'p': 'form/mask-input.vue', 'c': [], 'd': ['mask']},
31
+ 'r-progress-circular': {'p': 'progress/circular.vue', 'c': [], 'd': []},
32
+ 'r-progress-liner': {'p': 'progress/liner.vue', 'c': [], 'd': []},
33
+ 'r-img': {'p': 'img/index.vue', 'c': [], 'd': []},
34
+ 'r-chart': {'p': 'chart/chart.vue', 'c': [], 'd': []},
35
+ 'r-date-picker': {'p': 'form/datePicker/index.vue', 'c': [], 'd': []},
36
+ 'r-btn-group': {'p': 'button/buttonGroup.vue', 'c': [], 'd': ['click-outside']},
37
+ 'r-group-input': {'p': 'form/group-input.vue', 'c': [], 'd': []},
38
+ 'r-text-area': {'p': 'form/text-area.vue', 'c': [], 'd': []},
39
+ 'r-address': {'p': 'form/address.vue', 'c': [], 'd': []},
40
+ 'r-check-input': {'p': 'form/check-input.vue', 'c': [], 'd': []},
41
+ 'r-unique-feild': {'p': 'form/uniqueFeild/index.vue', 'c': [], 'd': []},
42
+ 'r-file-uploader': {'p': 'form/fileUploader/index.vue', 'c': [], 'd': []},
43
+ 'r-select': {'p': 'form/select.vue', 'c': [], 'd': ['click-outside']},
44
+ 'r-range': {'p': 'form/range.vue', 'c': [], 'd': ['touch']},
45
+ 'r-number': {'p': 'form/number.vue', 'c': [], 'd': []},
46
+ 'r-rating': {'p': 'form/rating.vue', 'c': [], 'd': []},
47
+ 'r-text-editor': {'p': 'form/text-editor/index.vue', 'c': [], 'd': []},
48
+ 'r-text-editor-preview': {'p': 'form/text-editor/preview.vue', 'c': [], 'd': []},
49
+ 'r-avatar': {'p': 'avatar/index.vue', 'c': [], 'd': []},
50
+ 'r-toolbar': {'p': 'bar/toolbar/index.vue', 'c': [], 'd': []},
51
+ 'r-bottom-navigation': {'p': 'bar/bottomNav.vue', 'c': [], 'd': []},
52
+ 'r-bottom-navigation-circle': {'p': 'bar/bottomNavigationCircle.vue', 'c': [], 'd': []},
53
+ 'r-breadcrumbs': {'p': 'breadcrumb/index.vue', 'c': [], 'd': []},
54
+ 'r-breadcrumbs-item': {'p': 'breadcrumb/bredcrumbItem.vue', 'c': [], 'd': []},
55
+ 'r-count-down': {'p': 'countdown/index.vue', 'c': [], 'd': []},
56
+ 'r-slider': {'p': 'slider/index.vue', 'c': [], 'd': ['touch']},
57
+ 'r-swiper': {'p': 'swiper/index.vue', 'c': [], 'd': ['touch']},
58
+ 'r-tabs': {'p': 'tabs/index.vue', 'c': [], 'd': []},
59
+ 'r-infinite-div': {'p': 'infinite/div.vue', 'c': [], 'd': ['scroll']},
60
+ 'r-infinite-page': {'p': 'infinite/page.vue', 'c': [], 'd': ['scroll']},
61
+ 'r-infinite-box': {'p': 'infinite/index.vue', 'c': [], 'd': []},
62
+ 'r-iframe': {'p': 'iframe/index.vue', 'c': [], 'd': []},
63
+ 'r-menu': {'p': 'menu/index.vue', 'c': [], 'd': ['click-outside']},
64
+ 'r-tree': {'p': 'tree/index.vue', 'c': [], 'd': []},
65
+ 'r-tree-element': {'p': 'tree/tree-element.vue', 'c': [], 'd': []},
66
+ 'r-float': {'p': 'float/index.vue', 'c': [], 'd': []},
67
+ 'r-timeline': {'p': 'timeline/index.vue', 'c': [], 'd': []},
68
+ 'r-password': {'p': 'form/password.vue', 'c': [], 'd': []},
69
+ 'r-color-picker': {'p': 'form/colorPicker/index.vue', 'c': [], 'd': ['touch']},
70
+ 'r-html2pdf': {'p': 'html2pdf/index.vue', 'c': [], 'd': []},
71
+ 'r-html2pdf-page-break': {'p': 'html2pdf/pageBreak.vue', 'c': [], 'd': []},
72
+ 'r-code-editor': {'p': 'codeEditor/index.vue', 'c': [], 'd': []},
73
+ 'r-map': {'p': 'map/index.vue', 'c': [], 'd': []},
74
+ 'r-map-select': {'p': 'map/select.vue', 'c': [], 'd': []},
75
+ 'r-map-route': {'p': 'map/route.vue', 'c': [], 'd': []},
76
+ 'r-tour': {'p': 'tour/index.vue', 'c': [], 'd': []},
77
+ 'r-chat': {'p': 'chat/index.vue', 'c': [], 'd': ['intersect', 'scroll']},
78
+ 'r-time-picker': {'p': 'form/timepicker/index.vue', 'c': [], 'd': []},
79
+ 'r-cam-input': {'p': 'form/camInput', 'c': [], 'd': []},
80
+ 'r-json': {'p': 'form/json/index.vue', 'c': [], 'd': []},
81
+ 'r-calendar': {'p': 'calendar/index.vue', 'c': [], 'd': []},
82
+ 'r-search-box': {'p': 'searchBox/index.vue', 'c': [], 'd': ['click-outside']},
85
83
  }
86
84
 
87
85
  export const register = (app, components) => {
86
+ let d = {}
88
87
  if (components.length === 0) {
89
88
  for (let c in list) {
90
89
  if (list.hasOwnProperty(c)) {
91
- app.component(c, require('./' + list[c]).default)
90
+ app.component(c, require('./' + list[c]['p']).default)
91
+ list[c]['d'].forEach((i) => {
92
+ d[i] = true
93
+ })
92
94
  }
93
95
  }
94
96
  } else {
95
97
  components.forEach((c) => {
96
98
  try {
97
- app.component(c, require('./' + list[c]).default)
99
+ app.component(c, require('./' + list[c]['p']).default)
100
+ list[c]['d'].forEach((i) => {
101
+ d[i] = true
102
+ })
98
103
  } catch (e) {
99
104
  console.error('component not found', c, e)
100
105
  }
101
106
 
102
107
  })
103
108
  }
109
+ return Object.keys(d)
104
110
  }
@@ -29,10 +29,9 @@
29
29
  </template>
30
30
 
31
31
  <script>
32
- import Scroll from "renusify/directive/scroll";
33
- export default {
32
+
33
+ export default {
34
34
  name: 'r-infinite-div',
35
- directives: {'scroll':Scroll},
36
35
  props: {
37
36
  isChat: Boolean,
38
37
  height: {
@@ -15,10 +15,9 @@
15
15
  </template>
16
16
 
17
17
  <script>
18
- import Scroll from "renusify/directive/scroll";
19
- export default {
18
+
19
+ export default {
20
20
  name: 'r-infinite-page',
21
- directives: {'scroll':Scroll},
22
21
  props: {
23
22
  url: {
24
23
  required: true,
@@ -22,11 +22,9 @@
22
22
 
23
23
  <script>
24
24
  import './style.scss'
25
- import Ripple from '../../directive/ripple/index'
26
25
 
27
26
  export default {
28
27
  name: 'r-list',
29
- directives: {ripple: Ripple},
30
28
  props: {
31
29
  disabled: Boolean,
32
30
  multiple: Boolean,
@@ -33,14 +33,11 @@
33
33
  </div>
34
34
  </template>
35
35
  <script>
36
- import clickOutside from '../../directive/clickOutSide/index'
37
36
 
38
37
  export default {
39
38
  name: 'r-menu',
40
- directives: {
41
- 'click-outside': clickOutside
42
- },
43
- props: {
39
+
40
+ props: {
44
41
  modelValue: {
45
42
  type: Boolean,
46
43
  default: false
@@ -47,14 +47,10 @@
47
47
  </div>
48
48
  </template>
49
49
  <script>
50
- import clickOutside from '../../directive/clickOutSide/index'
51
50
 
52
51
  export default {
53
52
  name: 'r-search-box',
54
53
  inheritAttrs: false,
55
- directives: {
56
- 'click-outside': clickOutside
57
- },
58
54
  props: {
59
55
  closable: Boolean,
60
56
  notFoundMsg: {
@@ -40,13 +40,9 @@
40
40
  </template>
41
41
 
42
42
  <script>
43
- import Touch from "../../directive/touch";
44
43
 
45
44
  export default {
46
45
  name: 'r-slider',
47
- directives: {
48
- 'touch': Touch
49
- },
50
46
  props: {
51
47
  slides: {
52
48
  type: Array,
@@ -37,13 +37,9 @@
37
37
  </template>
38
38
 
39
39
  <script>
40
- import Touch from "../../directive/touch";
41
40
 
42
41
  export default {
43
42
  name: 'r-swiper',
44
- directives: {
45
- 'touch': Touch
46
- },
47
43
  props: {
48
44
  items: Array,
49
45
  widthItem: Number,
@@ -105,13 +105,9 @@
105
105
 
106
106
  <script>
107
107
  import './style.scss'
108
- import Sortable from "../../directive/sortable";
109
108
 
110
109
  export default {
111
110
  name: 'r-table',
112
- directives: {
113
- 'sortable': Sortable
114
- },
115
111
  props: {
116
112
  transition: {
117
113
  type: String,
@@ -1,22 +1,21 @@
1
- import Ripple from './ripple/index'
2
- import clickOutside from './clickOutSide/index'
3
- import Title from "renusify/directive/title";
4
- import Scroll from "renusify/directive/scroll";
5
- import Sortable from "renusify/directive/sortable";
6
- import parallax from "renusify/directive/parallax";
7
- import Animate from "renusify/directive/animate";
1
+ const list = {
2
+ 'animate': 'animate',
3
+ 'click-outside': 'clickOutSide',
4
+ 'drag': 'drag',
5
+ 'intersect': 'intersect',
6
+ 'mask': 'mask',
7
+ 'parallax': 'parallax',
8
+ 'resize': 'resize',
9
+ 'ripple': 'ripple',
10
+ 'scroll': 'scroll',
11
+ 'sortable': 'sortable',
12
+ 'touch': 'touch',
13
+ 'title': 'title',
14
+
8
15
 
9
- const list={
10
- 'ripple':Ripple,
11
- 'click-outside':clickOutside,
12
- 'title':Title,
13
- 'scroll':Scroll,
14
- 'sortable':Sortable,
15
- 'parallax':parallax,
16
- 'animate':Animate,
17
16
  }
18
- export const registers = (app,directives) => {
19
- directives.forEach((item)=>{
20
- app.directive(item, list[item])
21
- })
17
+ export const registers = (app, directives) => {
18
+ directives.forEach((item) => {
19
+ app.directive(item, require('./' + list[item]).default)
20
+ })
22
21
  }