-1👍
The reason it doesn’t work is because popover injects it’s own html dynamically and obviously Vue does not compile this template.
You’ll have to use popover events to overcome this, it’s a bit hacky but i don’t see any other way:
var vm = new Vue({
el: '#app',
data: function() {
return {
message: 'hello'
}
},
methods: {
changeText: function() {
alert('test');
}
},
mounted: function() {
var self = this;
$('#example').popover({
html: true
})
.on('hidden.bs.popover', function() {
self.changeText()
}).parent().delegate('.btn-success', 'click', function() {
$('#example').popover('hide')
});
}
});
- [Vuejs]-Reference to DOM element in Vue,js component computed property
- [Vuejs]-Vue.js net::ERR_INCOMPLETE_CHUNKED_ENCODING Webpack error
Source:stackexchange.com