handleAfterInit.js 280 B

1234567891011121314
  1. function handleAfterInit() {
  2. let classStr = ''
  3. this.data.__classNames
  4. .forEach((key) => {
  5. classStr += (this.props[key] || '')
  6. })
  7. if (this.data._classes !== classStr) {
  8. this.setData({
  9. _classes: classStr,
  10. })
  11. }
  12. }
  13. module.exports = handleAfterInit