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 +60 -0
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.iife.js +2 -2
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/nuxt/index.cjs +25083 -0
- package/dist/nuxt/index.cjs.map +7 -0
- package/dist/nuxt/index.d.ts +40 -0
- package/dist/nuxt/index.mjs +8736 -0
- package/dist/nuxt/index.mjs.map +7 -0
- package/dist/nuxt/runtime/plugin.mjs +8708 -0
- package/dist/nuxt/runtime/plugin.mjs.map +7 -0
- package/package.json +19 -2
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.
|
|
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.
|
|
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.
|