You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

form-input.js 756B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // components/form/form-input/form-input.js
  2. Component({
  3. properties: {
  4. label: String,
  5. value: String,
  6. type: String,
  7. requiredMark: {
  8. type: Boolean,
  9. value: true
  10. },
  11. activeMode: {
  12. type: Boolean,
  13. value: true
  14. },
  15. },
  16. observers: {
  17. 'value': function (val) {
  18. let self = this;
  19. if(val) {
  20. self.setData({
  21. inputValue: val
  22. })
  23. } else {
  24. self.setData({
  25. inputValue: ''
  26. })
  27. }
  28. },
  29. },
  30. data: {
  31. inputValue: '',
  32. styleCss: 'line-height: 36rpx; font-size: 28rpx; border-bottom: 1rpx dashed #f0f0f0;'
  33. },
  34. methods: {
  35. blurValue(e) {
  36. let self = this;
  37. self.triggerEvent('getvalue', {val: e.detail.value})
  38. }
  39. }
  40. })