vuejs / Discussion

Vue.js discussion
167 stars 17 forks source link

Option: replace false , not working #485

Closed Dongss closed 8 years ago

Dongss commented 8 years ago

My plugin:

Vue.prototype.$alert = function(header, content) {
    let alertVue = new Vue({
        replace: false,
        el: 'body',                                     
        template: alertTemplate,
        data () {
            return {
                header: header,
                content: content
            };
        },
...

HTML

<body>
    <div id="app">                    
        <router-view ></router-view>
    </div>
...

Then here index.vue this.$alert('header', 'content');

Body always is replaced ..

Change el from body to #app , not working too

Thanks for any help