switch

    1. Page({
    2. data: {
    3. color: '',
    4. colorList: [{
    5. name: 'blue',
    6. value: "蓝色"
    7. }, {
    8. name: '#333',
    9. name: '',
    10. value: "默认样式",
    11. checked: 'true'
    12. }],
    13. },
    14. switch1Change: function (e) {
    15. switch2Change: function (e) {
    16. console.log('switch2 发生 change 事件,携带值为', e.detail.value);
    17. },
    18. changeColor(e) {
    19. console.log(e);
    20. this.setData({
    21. color: e.detail.value
    22. });