index.js 748 B

12345678910111213141516171819202122232425262728293031323334
  1. "use strict";
  2. var _page = _interopRequireDefault(require("../../common/page"));
  3. var _dialog = _interopRequireDefault(require("../../dist/dialog/dialog"));
  4. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  5. (0, _page["default"])({
  6. data: {
  7. checked: true,
  8. checked2: true
  9. },
  10. onChange: function onChange(_ref) {
  11. var detail = _ref.detail;
  12. this.setData({
  13. checked: detail
  14. });
  15. },
  16. onChange2: function onChange2(_ref2) {
  17. var _this = this;
  18. var detail = _ref2.detail;
  19. _dialog["default"].confirm({
  20. title: "提示",
  21. message: "是否切换开关?"
  22. }).then(function (res) {
  23. _this.setData({
  24. checked2: detail
  25. });
  26. });
  27. }
  28. });