ams icon indicating copy to clipboard operation
ams copied to clipboard

`actions`改名为`methods`

Open w3cmark opened this issue 4 years ago • 0 comments

目前的配置:

const config = {
    type: 'list',
    actions: {
       init: function() {
           ...
       }
    },
    on: {
        change: function() { // 透传element的Events事件
            ...
        },
        click: function() { // 原生事件
            ...
        }
    }
}

优化方案:

actions改名为methods,和vue一致,减少概念隔阂(this.callAction方法废弃,跨区块方法直接使用this.$emitEvent('xxx.xxx'),调用顺序是先触发events,没有再去触发methods)

const config = {
    type: 'list',
    methods: {
        init: function() {
           ...
        }
    },
    on: {
        change: function() { // 透传element的Events事件
            ...
        },
        click: function() { // 原生事件
            ...
        }
    }
}

w3cmark avatar Dec 22 '19 14:12 w3cmark