vue3中jsx自定义指令的使用


自定义指令

只有 argument 的时候推荐使用

const App = {
  directives: { custom: customDirective },
  setup() {
    return () => <a v-custom:arg={val} />;
  },
};
const App = {
  directives: { custom: customDirective },
  setup() {
    return () => <a v-custom={[val, "arg", ["a", "b"]]} />;
  },
};

文档中的描述看得我一愣一愣的,vue3+jsx使用自定义指令具体是什么步骤呢

又看了一遍v3官网文档才反应过来,其实就是通过数组[val, "arg", ["a", "b"]传递值,自定义指令的参数,修饰符😓

https://blog.csdn.net/qq_24767091/article/details/119239113