diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index af573d8..9738eac 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -28,6 +28,13 @@ export default { {text: "Use in Components", link: '/usage/components'}, ] }, + { + text: 'Examples', + collapsible: true, + items: [ + {text: 'Filter Components', link: '/examples/filter-components'}, + ] + }, { text: 'API', collapsible: true, diff --git a/docs/examples/filter-components.md b/docs/examples/filter-components.md new file mode 100644 index 0000000..b0918dc --- /dev/null +++ b/docs/examples/filter-components.md @@ -0,0 +1,165 @@ +# Writing Filter Components +Writing filter components in Harness-Vue is easy thanks to Vue and Pinia. Filters in Harness-Vue as abstractions around a pinia store - but at their core, they have a getter (`getFilter`) and a setter (`setFilter`). + +[[toc]] + +## Using Form Inputs +Let's see a few ways we can apply these concepts, along with Vue's `v-model`, in practice. + +The following is a basic form input definition in Vue, using v-model. +```vue + + +``` + +Using Harness-Vue's API and a [writeable computed](https://vuejs.org/guide/essentials/computed.html#writable-computed) function, we can achieve the same. + +```vue + + +``` + +### Reuseable Filter + +```vue + + +``` + +### Running `loadData()` + +```vue + + +``` + +### Select with Options + +```vue + + +``` +### With Multiple Values + +```vue + + +``` \ No newline at end of file