Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Vue Routing with AEM

Avatar

Avatar
Validate 1
Level 2
sateeshk9319722
Level 2

Likes

2 likes

Total Posts

27 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
sateeshk9319722
Level 2

Likes

2 likes

Total Posts

27 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
sateeshk9319722
Level 2

13-08-2020

Hello all,

How to use routing of vue js in AEM.

Use Case: We have a component called "Login" , I want to load one more component if the user logged in successfully

FYI: The Vue components are integrated with AEM and we are loading the AEM components on the page.

 

Many thanks. 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
ChitraMadan
MVP

Likes

227 likes

Total Posts

124 posts

Correct Reply

50 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Establish
MVP
ChitraMadan
MVP

Likes

227 likes

Total Posts

124 posts

Correct Reply

50 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile
ChitraMadan
MVP

13-08-2020

Hi @sateeshk9319722,

 

May be you can try to trigger event from 1 view to another.

 

So, when a user logs in, you can fire the event which the other view/component will be listening to.

You can refer to this article https://www.danvega.dev/blog/2019/06/05/triggering-events-router-vue/

 

We did something similar to this using broadcasts in angular js. May be you can try on the same lines.

function postUserLoggedIn(options) {
$rootScope.$broadcast('userLoggedIn');
$window.parent.postMessage({
action: 'userLoggedIn',
profile: options.profile,
idToken: options.idToken || undefined
}, '*');
 
$scope.$on('userLoggedIn', function () {
$scope.isLoggedIn = true;
fillUserDetails();
});
}

 

 

Answers (2)

Answers (2)

Avatar

Avatar
Give Back 3
Level 4
SundeepKatepally
Level 4

Likes

76 likes

Total Posts

76 posts

Correct Reply

21 solutions
Top badges earned
Give Back 3
Boost 10
Boost 25
Boost 50
Affirm 10
View profile

Avatar
Give Back 3
Level 4
SundeepKatepally
Level 4

Likes

76 likes

Total Posts

76 posts

Correct Reply

21 solutions
Top badges earned
Give Back 3
Boost 10
Boost 25
Boost 50
Affirm 10
View profile
SundeepKatepally
Level 4

13-08-2020

Does contexthub solves your use case  ? based on a defined segment (in your case user logged in) you will show the component else not.

Avatar

Avatar
Give Back 5
Employee
vanegi
Employee

Likes

389 likes

Total Posts

377 posts

Correct Reply

147 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 50
View profile

Avatar
Give Back 5
Employee
vanegi
Employee

Likes

389 likes

Total Posts

377 posts

Correct Reply

147 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 50
View profile
vanegi
Employee

13-08-2020