Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/compiler/ComponentParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ class ${name} extends AvenxComponent {
});
}

const dirRegex = /\b(data-ax-show|data-ax-class|data-ax-html)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
const dirRegex = /\b(data-ax-[a-zA-Z0-9_-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
let dirMatch;
while ((dirMatch = dirRegex.exec(match[0])) !== null) {
events.push({
Expand Down
16 changes: 16 additions & 0 deletions lib/core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ export class AvenxApp {
*/
bridges: Record<string, any>;

/**
* Registered custom directives.
*/
directives: Map<string, any>;

/**
* Active router instance.
*/
Expand Down Expand Up @@ -395,6 +400,17 @@ export class AvenxApp {
* @param callback Callback triggered when an unhandled lifecycle or event handler error occurs.
*/
onError(callback: (error: Error, component: AvenxComponent, origin: string) => void): this;

/**
* Registers a custom directive.
* @param name Directive name.
* @param definition Directive lifecycle definition.
*/
directive(name: string, definition: {
mounted?(el: any, binding: { value: any; expression: string }): void;
updated?(el: any, binding: { value: any; oldValue: any; expression: string }): void;
unmounted?(el: any, binding: { value: any; oldValue: any; expression: string }): void;
}): this;
}

/**
Expand Down
Loading
Loading