I have been watching WeChat Mini Programs recently. About the usage of definitionFilter function, I don"t understand
for example
// behavior.js
module.exports = Behavior({
definitionFilter(defFields) {
defFields.data.from = "behavior"
},
})
// component.js
Component({
data: {
from: "component"
},
behaviors: [require("behavior.js")],
ready() {
console.log(this.data.from) // behavior component
}
})
in the code above, what does it mean to add {} after the definitionFilter function is called, and why?
A little depressed