forked from buefy/buefy
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): rewrite sortablejs extension in TS (#406)
Rewrites the documentation for the sortable extension in the `src/pages/extensions/sortablejs` in TypeScript. Also includes overlooked Vue 2 → 3 migration. In `examples/ExSimple.vue`: - Adapts the `createSortable` function so that it works well with the Vue 3 directive API: - Accepts an instance of `BTaginput` instead of `VNode`. The component instance should be obtained from the `binding` parameter rather than the `vnode` parameter in the Vue 3 directive API. - The `$buefy` global property is a part of `ComponentPublicInstance`; i.e., can be accessed via a `BTaginput` instance - Refurbishes the `sortable` directive using the Vue 3 directive API: - `bind` → `beforeMount` - `update` → `updated` - `unbind` → `unmounted` - Introduces a new interface `SortablejsContainer` which facilitate accessing the `_sortable` field attached to `HTMLElement` In `Sortablejs.vue`: - Wraps `ExSimple` in a `shallowRef` call to address the warning about making a component instance reactive A tip for TypeScript migration: - Explicitly import and register Buefy components so that they are type-checked. Note that no type-checking is performed for globally registered components.
- Loading branch information
Showing
2 changed files
with
64 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters