directix 1.5.0 → 1.6.0

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
@@ -128,6 +128,66 @@ const { run: debouncedSearch } = useDebounce({ handler: search, wait: 500 })
128
128
 
129
129
  See the [Composables](#composables) section below for all available composables.
130
130
 
131
+ ## Nuxt Integration
132
+
133
+ Directix provides a Nuxt module for seamless integration with Nuxt 3 applications.
134
+
135
+ ### Installation
136
+
137
+ The Nuxt module is included in the main package. Simply add it to your `nuxt.config.ts`:
138
+
139
+ ```typescript
140
+ // nuxt.config.ts
141
+ export default defineNuxtConfig({
142
+ modules: ['directix/nuxt'],
143
+
144
+ directix: {
145
+ // Enable/disable the module (default: true)
146
+ enabled: true,
147
+
148
+ // Only include specific directives (optional)
149
+ include: ['v-click-outside', 'v-copy', 'v-debounce'],
150
+
151
+ // Or exclude specific directives (optional)
152
+ exclude: ['v-ripple'],
153
+
154
+ // Default options for directives (optional)
155
+ directiveOptions: {
156
+ 'v-permission': {
157
+ config: {
158
+ getPermissions: () => ['read', 'write']
159
+ }
160
+ }
161
+ },
162
+
163
+ // Auto-import composables (default: true)
164
+ autoImportComposables: true
165
+ }
166
+ })
167
+ ```
168
+
169
+ ### Usage in Nuxt
170
+
171
+ Directives are automatically registered and composables are auto-imported:
172
+
173
+ ```vue
174
+ <template>
175
+ <div v-click-outside="handleClose">
176
+ <button v-copy="text">Copy</button>
177
+ </div>
178
+ </template>
179
+
180
+ <script setup>
181
+ // Composables are auto-imported, no need to import manually
182
+ const { copy, copied } = useCopy({ source: text })
183
+ const { isHovering } = useHover({ onEnter: handleEnter })
184
+ </script>
185
+ ```
186
+
187
+ ### SSR Compatibility
188
+
189
+ Directives that are not SSR-compatible will only run on the client side. The Nuxt module handles this automatically.
190
+
131
191
  ## Available Directives
132
192
 
133
193
  ### Event Directives
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * directix v1.5.0
2
+ * directix v1.6.0
3
3
  * A comprehensive, easy-to-use, and high-performance Vue custom directives library supporting both Vue 2 and Vue 3
4
4
  * (c) 2021-present saqqdy <https://github.com/saqqdy>
5
5
  * Released under the MIT License.
@@ -78,7 +78,7 @@ var __async = (__this, __arguments, generator) => {
78
78
  });
79
79
  };
80
80
  /*!
81
- * directix v1.5.0
81
+ * directix v1.6.0
82
82
  * A comprehensive, easy-to-use, and high-performance Vue custom directives library supporting both Vue 2 and Vue 3
83
83
  * (c) 2021-present saqqdy <https://github.com/saqqdy>
84
84
  * Released under the MIT License.