Skip to content

Vue compilation errors when I use view_render_event() in the create.blade.php file #2315

@fabGutin

Description

@fabGutin

Hello everyone,
I have vue compilation errors (of type Uncaught SyntaxError: Unexpected token '>') when I use view_render_event() in the create.blade.php file (/packages/Webkul/Admin/src/Resources/views/leads/create.blade.php)

For example if I inject this code in the admin.leads.create.details.after hook

<x-admin::attributes
:custom-attributes="app('Webkul\Attribute\Repositories\AttributeRepository')->findWhere([
['code', 'IN', ['description']],
'entity_type' => 'leads',
'quick_add'   => 1
])"
/>

I have a vue compilation error.

I don't have this problem by injecting the same code into the admin.leads.edit.lead_details.attributes.before hook of the edit.blade.php file (/packages/Webkul/Admin/src/Resources/views/leads/edit.blade.php)

Can you please help me to inject this type of code in the hooks of the create.blade.php file ?

Also to use translations in injected code if I use this kind a syntax @lang('admin::app.leads.create.save-btn') i have an error. I must use this syntax <?php echo __('admin::app.leads.create.save-btn'); ?> to avoid errors. Not really a problem because It works with the php syntax but I would like to understand why I cannot use the classic translation syntax (@lang(...)) in injected code.

Many thanks for your help

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions