Skip to content

Custom directive in render function #855

Closed
@shameleo

Description

@shameleo

In Vue 2 directives should be passes to directives property of VNode data object.
In Vue 3 data object has flat structure, but no examples of how to use directives.
Tried this:

import { h } from 'vue';
import { focus } from '@scripts/directives.js';

export default {
    directives: {
        focus
    },
    render: () => h('input', {
        type: 'text',
        vFocus: true
    });
}

and many other suggestions without any success.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions