Using VueJS and importing Lodash therein. When using a lodash function such as _.forEach
, this
within the function body refers to the lodash instance. How do I make this
to point to the Vue component's instance instead?
_.forEach(records, function(val)
{
if (this.max_records >0) // max_records is defined in data(), so this should be the cimponent instance
{
}
});