You need to sign in to do that
Don't have an account?
IntroAmmy
Need help on LWC while passing the parameter from one LWC component to another LWC component
Here is the existing code , when navurl gets call from HTML
method in js
--------------------------
navUrl(e) {
var selIndex = e.target.dataset.value;
window.open(this.allData2Symp[selIndex].docLinks); //its open the document based on link
}
--------------------------------------------------------------------------------------
trying to change here(instead of navurl menthod created new method handlenavigte- html is same) and trying to pass the link to new component
handleNavigate(e) {
var selIndex = e.target.dataset.value;
//window.open(this.allData2Symp[selIndex].docLinks);
var link = this.allData2Symp[selIndex].docLinks;
//console.log('@@' + selIndex);
this[NavigationMixin.Navigate]({
type: 'comm__namedPage',
attributes: {
name: 'test__c', // new page created and binded newly created component in page
},
state: {
c__propertyValue: link
}
});
}
new component html where i am passing the link
<template>
<video name="media" controls autoplay controlslist="nodownload" width="620" height="640" >
<source src={link} type="video/mp4">
</video>
</template>
new component JS
import { LightningElement, api } from 'lwc';
export default class TargetLwcComponent extends LightningElement {
@api link;
}
Can someone please help me on that
method in js
--------------------------
navUrl(e) {
var selIndex = e.target.dataset.value;
window.open(this.allData2Symp[selIndex].docLinks); //its open the document based on link
}
--------------------------------------------------------------------------------------
trying to change here(instead of navurl menthod created new method handlenavigte- html is same) and trying to pass the link to new component
handleNavigate(e) {
var selIndex = e.target.dataset.value;
//window.open(this.allData2Symp[selIndex].docLinks);
var link = this.allData2Symp[selIndex].docLinks;
//console.log('@@' + selIndex);
this[NavigationMixin.Navigate]({
type: 'comm__namedPage',
attributes: {
name: 'test__c', // new page created and binded newly created component in page
},
state: {
c__propertyValue: link
}
});
}
new component html where i am passing the link
<template>
<video name="media" controls autoplay controlslist="nodownload" width="620" height="640" >
<source src={link} type="video/mp4">
</video>
</template>
new component JS
import { LightningElement, api } from 'lwc';
export default class TargetLwcComponent extends LightningElement {
@api link;
}
Can someone please help me on that