Vue Version 3
v-tables-3
While the migrated package has been tested, this is still an alpha version.
Install the vue3
branch:
Require scripts:
Initialize app:
Register component(s):
The above code is only for the purpose of documentation. The actual code would look something like this:
app.use(ServerTable, {}, 'bootstrap4')
Note that the useVuex
option was removed
The new `themeOverride` parameter allows you to customize the existing theme (for reference theme files are located under lib/themes)
Breaking Changes
There are almost no breaking changes, so in case you are migrating for v2, you can continue using your old code base with the following in mind:
The event bus now uses the
mitt
package: a. to avoid naming collisions the import is nowEventBus
. instead ofEvent
. b. Instead ofEvent.$on
, useEventBus.on
c. instead ofEvent.$emit
useEventBus.emit
Vuex
option was removed. See above.When using a custom template refer to the
templates
folder of the premium package, as there are some minor changesWhen using a custom template use `markRaw`, e.g:
Editable cells: due to changes in v-model behavior use the following syntax instead (add an `input` event listener and assign the payload to your data property):
Be sure to also change the format of the cell template to accord with Vue 3 syntax. E.g:
Known Warnings
During development Vue will issue some warnings, which you can safely ignore. They will not be displayed on the production build.
Expect to see the following warning in the console while developing:
Vue 3 expects you to define emitted events in advance. This is not possible for dynamic event names, such as
filter::[columnName].
For example:
Component emitted event "filter::id" but it is neither declared in the emits option nor as an "onFilter::id" prop.
Last updated