You can reference a property directly in your component using variables.data.[ property name ].
// File: wires/Counter.cfccomponentextends="cbwire.models.Component"{ // Data propertiesvariables.data={"counter":0}; // Action called from UIfunctionincrement(){variables.data.counter+=1;}...}
You can also reference any defined properties from your cbwire component view using args.[ property name ].
Things To Know
Your component's private variables scope will hold your data property definitions and current values, which is seemingly secure, but it's necessary to be cautious about what you store. cbwire communicates with the server via Livewire using AJAX requests and includes the current state of the data properties within those requests.
cbwire includes the current values of the data properties during requests to determine what state has changed and if Livewire should update the DOM.
You should NEVER store sensitive data ( such as passwords, SSNs ) that you wouldn't want your application's users to see.
Data properties can only be data types that are castable to JavaScript data types, such as CFML strings, numeric, arrays, structs, or booleans.