Skip to content

Directix Playground

交互式配置指令并生成 Vue 2、Vue 3、组合式函数和 Nuxt 代码。

🎯 Code Generator v-debounce
Debounce function execution
Vue
<template>
  <div v-debounce="{
    handler: 'handleInput',
    wait: 300,
    leading: false,
    trailing: true
  }">
    <!-- Debounce function execution -->
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'

// Directive options
const options = {
  handler: 'handleInput',
    wait: 300,
    leading: false,
    trailing: true
}
</script>

快速开始

  1. 选择指令 - 从 57+ 指令中选择,按类别组织
  2. 选择 Vue 版本 - 切换 Vue 2 或 Vue 3
  3. 选择输出格式 - 指令语法或组合式函数
  4. 复制代码 - 点击复制并粘贴到您的项目中

功能特性

  • 57+ 指令 - 覆盖所有 Directix 指令
  • 41+ 组合式函数 - 每个指令对应的组合式 API
  • Vue 2 & Vue 3 - 生成任意版本代码
  • TypeScript 支持 - 完整类型定义
  • 15 个分类 - 按使用场景组织

分类

分类描述指令
事件事件处理v-click-outside, v-debounce, v-throttle, v-long-press, v-hover, v-hotkey, v-click-delay, v-click-wave, v-context-menu, v-copy
可见性可见性控制v-lazy, v-intersect, v-visible, v-loading, v-blur, v-skeleton
滚动滚动行为v-scroll, v-infinite-scroll, v-sticky, v-parallax, v-progress
交互用户交互v-ripple
格式化文本格式化v-uppercase, v-lowercase, v-capitalcase, v-number, v-money, v-truncate, v-ellipsis, v-trim
UIUI 增强v-tooltip, v-draggable, v-image-preview, v-countdown, v-watermark, v-print
表单表单处理v-focus, v-mask
安全安全功能v-permission, v-sanitize
观察者DOM 观察v-resize, v-mutation
性能性能优化v-virtual-list
移动端触摸手势v-touch, v-swipe, v-pan, v-pinch, v-rotate-gesture, v-pull-refresh
动画动画效果v-fade, v-typewriter, v-counter, v-lottie
数据数据处理v-export, v-highlight
媒体媒体控制v-fullscreen
输入输入处理v-emoji

使用示例

vue
<template>
  <!-- 在此使用生成的指令代码 -->
  <input v-debounce="{ handler: handleSearch, wait: 300 }" />
</template>

<script setup>
import { ref } from 'vue'

const searchText = ref('')

function handleSearch(event) {
  console.log('搜索:', event.target.value)
}
</script>

v1.11.0 功能

  • 🏢 企业级功能 - 权限管理、审计日志、配置中心
  • 性能优化 - 包体积减小、运行时性能提升
  • 🛡️ 安全增强 - 高级 XSS 防护、CSP 兼容性
  • 📊 监控告警 - 性能指标、健康检查、告警规则

v2.0.0 即将推出

  • 🧩 Web Components 支持 - 在自定义元素中使用指令
  • Vue 3 条件优化 - markRaw、shallowReactive 增强
  • 🔄 完全 Vue 2 兼容 - 持续支持 Vue 2.x

需要帮助?

基于 MIT 许可发布