@stsdti/approvable-vue 0.1.0 → 0.1.6

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/README.md CHANGED
@@ -94,13 +94,27 @@ The renderer receives `button`, `step`, `approvable`, `resource` and a
94
94
 
95
95
  ## Configuration
96
96
 
97
+ The HTTP client is optional: with no configuration the components use `fetch`
98
+ and echo the `XSRF-TOKEN` cookie back as `X-XSRF-TOKEN`, so Laravel's CSRF check
99
+ passes. Configure it when you want your own axios instance — its `baseURL`,
100
+ interceptors and auth:
101
+
102
+ ```js
103
+ import { configureApprovableClient } from '@stsdti/approvable-vue'
104
+
105
+ configureApprovableClient({ axios }) // your axios instance
106
+ configureApprovableClient({ fetch: myFetch }) // a custom fetch
107
+ configureApprovableClient({ baseURL: '/admin-api' }) // default transport, other prefix
108
+ configureApprovableClient({ adapter: myAdapter }) // anything else
109
+ ```
110
+
97
111
  Notifications and date formatting are configured on the core package:
98
112
 
99
113
  ```js
100
- import { setApprovableNotifier, setApprovableClient, ApprovableClient, axiosAdapter } from '@stsdti/approvable-core'
114
+ import { setApprovableNotifier, setApprovableDateFormatter } from '@stsdti/approvable-core'
101
115
 
102
116
  setApprovableNotifier({ success: toast.success, error: toast.error })
103
- setApprovableClient(new ApprovableClient({ adapter: axiosAdapter(axios) }))
117
+ setApprovableDateFormatter((value) => dayjs(value).format('LLL'))
104
118
  ```
105
119
 
106
120
  ## License