New answers tagged

2

Is it possible to use @wire in classes that do not inherit from LightningElement? No. You can save/deploy the file, but it won't work. Dragging it onto a page (even without a HTML file) will throw the following error: class n{yourWiredFunction({data:e,error:t}){}} is not a valid component, or does not extends LightningElement from "lwc". You ...


0

It is working fine for me. Check below piece of code:- import { LightningElement, track } from 'lwc'; export default class Summer21 extends LightningElement { @track states = { first: true, second: false }; connectedCallback(){ console.log(Object.values(this.states).some(v => v === true)); console.log(Object....


0

I see that you have not declared the variable 'fields' in your js file on which you are performing the 'split' operation, Please declare and initialize the variable and then try.


0

you might want to refer to the documentation: Access Elements the Component Owns Don’t use the window or document global properties to query for DOM elements. See DOM Access Containment. Also, we don’t recommend using JavaScript to manipulate the DOM. It's better to use the Lightning Web Components HTML directives to write declarative code. in a nutshell, ...


Top 50 recent answers are included