[Vuejs]-Vue removing elements when using new Vue?

1๐Ÿ‘

You should move the template to the vue instance.

var button = new Vue({
    el: '#vb',
    methods: {
        next1: function() {
            alert("pressed!")
        }
    },
    template: `
        <a class="button is-rounded is-medium" v-on:click="next1">Lets get started.</a>
    `
  })

And the element you are mounting to should be simply:

<div id="#vb"></div>
๐Ÿ‘คT. Short

0๐Ÿ‘

Okay, this is a little weird but I managed to get it working.

<meta http-equiv="Content-Security-Policy" content="script-src 'self';" /> was stopping it from working. Removing that line makes it work perfectly. Thanks for your suggestions though ๐Ÿ™‚

๐Ÿ‘คSean

Leave a comment