From eb3cc8ffe4ef19d1ca057d47922c345ce031ee6b Mon Sep 17 00:00:00 2001 From: Rogerio Angeliski Date: Sat, 2 Mar 2019 16:38:02 -0300 Subject: [PATCH] Update docs with advanced --- README.md | 4 ++++ docs/guide/README.md | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/README.md b/README.md index 6e1d28b..049f9ba 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,10 @@ Work in Progress. PR are welcome. +# Documentation + +You can see the full documentation in: [https://angeliski.github.io/vue-tabulator/](https://angeliski.github.io/vue-tabulator/). + # Getting Started The vue-tabulator is a wrapper to Tabulator, so you need [install the tabulator](http://tabulator.info/docs/4.2/install#sources-npm) to use vue-tabulator. diff --git a/docs/guide/README.md b/docs/guide/README.md index 7e57698..5d20c50 100644 --- a/docs/guide/README.md +++ b/docs/guide/README.md @@ -70,3 +70,24 @@ Note: The object options use the Vue [watcher](https://vuejs.org/v2/guide/comput ## v-model You can provide a array to populate your table, the component will use the [data property](http://tabulator.info/docs/4.2/data#array-initial) to initialize the Tabulator. Any change performed in your v-mode will be reflected in the component, using the [Tabulator reactivity](http://tabulator.info/docs/4.2/reactivity) and Vue [watcher](https://vuejs.org/v2/guide/computed.html#Watchers). + +## Advanced Interaction + +In some cases you will be need use a feature provided by the Tabulator, but not supported by the vue-tabulator. If you need some like that, you can use the tabulator instance from your component. + +Using the [ref](https://vuejs.org/v2/api/#ref) in your component + +```html{2} + +``` + +You have access to method getInstance who will return the Tabulator instance. + +```javascript{1} +const tabulatorInstance = this.$refs.tabulator.getInstance(); +tabulatorInstance.clearData(); +``` + +::: warning be careful +When use the Tabulator instance will can broke some behaviors in the vue-tabulator. That can happening because the Tabulator is a JavaScript library and the vue-tabulator is a wrapper for that lib to more easyly use in vue. +:::