如何使用超类的方法进行子类化

时间:2019-08-07 02:16:17

标签: javascript vue.js

我想在按钮单击后发出警报。

这是我的代码,它不起作用:

const supervue = new vue({
    el:'#test',
    methods:{
        hi(){
            return alert('hello world');
        }

    },
    components:{
        "abc" : abc,
    }
})

const subvue = {
    props:['propsdata'],
    templates: ' <button v-on:click="propsdata.hi">click!</button>'
}

<div id="test">
    <abc v-bind:propsdata="supervue"></abc>
    <file-wrap v-bind:propsdata="fileWrapData"></file-wrap>
</div>

谢谢。

0 个答案:

没有答案