Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mechanism to initialize vue components outside of angularjs #18804

Merged
merged 1 commit into from Feb 16, 2022

Conversation

diosmosis
Copy link
Member

Description:

This PR introduces a method to initialize entry Vue components without angularjs. Add the vue-entry="Plugin.Component" attribute to an element in a twig template and the Vue component will be initialized. Currently the attributes are only handled on the initial page load. Vue components used in old vanilla controller action results will need to have the new piwikHelper.compileVueEntryComponents() method called on the HTML. This method should not be mixed with piwikHelper.compileAngularComponents(). Other HTML attributes are used as input props to the component. The attributes can be JSON encoded.

Used in last tag-manager pull request.

Changes:

  • Add piwikHelper.compileVueEntryComponents() which initializes elements w/ vue-entry as the Vue components the attribute references.
  • Call the above function once on document ready.

Review

@diosmosis diosmosis added the Needs Review PRs that need a code review label Feb 16, 2022
@diosmosis diosmosis added this to the 4.8.0 milestone Feb 16, 2022
Copy link
Contributor

@peterhashair peterhashair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@peterhashair peterhashair merged commit 2463389 into 4.x-dev Feb 16, 2022
@peterhashair peterhashair deleted the vue-entry branch February 16, 2022 23:03
@justinvelluppillai justinvelluppillai changed the title [Vue] Add mechanism to initialize vue components outside of angularjs Add mechanism to initialize vue components outside of angularjs Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants