innoboxrr-vue-datatable 1.2.26 → 1.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.
package/package.json
CHANGED
package/src/DataTable.vue
CHANGED
|
@@ -101,6 +101,7 @@
|
|
|
101
101
|
|
|
102
102
|
<script>
|
|
103
103
|
|
|
104
|
+
import { markRaw } from 'vue';
|
|
104
105
|
import NavDropdownComponent from './components/NavDropdownComponent.vue'
|
|
105
106
|
import IconRouteComponent from './components/IconRouteComponent.vue'
|
|
106
107
|
import IconLinkComponent from './components/IconLinkComponent.vue'
|
|
@@ -190,7 +191,7 @@
|
|
|
190
191
|
meta: [],
|
|
191
192
|
links: []
|
|
192
193
|
},
|
|
193
|
-
dataTableComponents: this.
|
|
194
|
+
dataTableComponents: this.registerComponents(),
|
|
194
195
|
sort: this.model.dataTableSort(),
|
|
195
196
|
orderBy: 'id',
|
|
196
197
|
internalSort: false,
|
|
@@ -228,6 +229,15 @@
|
|
|
228
229
|
}
|
|
229
230
|
return cols;
|
|
230
231
|
},
|
|
232
|
+
registerComponents() {
|
|
233
|
+
// Usar `markRaw` para cada componente
|
|
234
|
+
let components = Object.keys(this.model.dataTableComponents())
|
|
235
|
+
.reduce((acc, key) => {
|
|
236
|
+
acc[key] = markRaw(this.model.dataTableComponents()[key]);
|
|
237
|
+
return acc;
|
|
238
|
+
}, {});
|
|
239
|
+
return components;
|
|
240
|
+
},
|
|
231
241
|
fetchData() {
|
|
232
242
|
const requestData = {
|
|
233
243
|
method: this.dataMethod,
|
|
@@ -97,7 +97,6 @@
|
|
|
97
97
|
|
|
98
98
|
<script>
|
|
99
99
|
|
|
100
|
-
import { shallowRef } from 'vue';
|
|
101
100
|
import NavDropdownComponent from './NavDropdownComponent.vue'
|
|
102
101
|
import IconRouteComponent from './IconRouteComponent.vue'
|
|
103
102
|
import IconLinkComponent from './IconLinkComponent.vue'
|
|
@@ -134,12 +133,8 @@
|
|
|
134
133
|
},
|
|
135
134
|
emits: ['sortColumn', 'actionButtonClicked', 'actionClicked'],
|
|
136
135
|
setup(props) {
|
|
137
|
-
// Registrar componentes dinámicos
|
|
138
|
-
const components = shallowRef(props.dataTableComponents);
|
|
139
|
-
|
|
140
|
-
// Resolver el componente dinámico desde el mapeo
|
|
141
136
|
const getComponent = (componentName) => {
|
|
142
|
-
return
|
|
137
|
+
return props.dataTableComponents[componentName] || null;
|
|
143
138
|
};
|
|
144
139
|
|
|
145
140
|
return {
|