Vue learning 17: Bind native events to components

Vue.component('child', {
            template: `<div>Hello world</div>`
        })
        var app = new Vue ({
            el: '# app',
            methods: {
                handleClick() {
                    alert('click')
                }
            }
        })
Binding native events to components is easy, just add a native after the click. native translation: native, native, natural

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325847597&siteId=291194637
Recommended