Tôi có một trang để liệt kê dữ liệu từ bảng sử dụng VueJs và Laravel. Dữ liệu danh sách thành công. Xóa và chỉnh sửa chức năng đang diễn ra. Vì mục đích đó tôi đã thêm hai số <span> (glyphicon-pencil), <span> (glyphicon-trash)
. Nếu cả hai <span>
đều nằm ngoài các chú giải công cụ <template>
, nếu không nó sẽ không hoạt động. Bạn có biết cách tooltip bootstrap hoạt động bên trong Vue Js hay không. Cảm ơn.Cách thêm chú giải công cụ khởi động trong Vue Js
page.blade.php
<template id="tasks-template">
<table class="table table-responsive table-bordered table-hover">
<thead>
<tr>
<th>#</th>
<th>Id</th>
<th>Religion</th>
<th>Action</th>
<th>Created</th>
<td>Status</td>
</tr>
</thead>
<tbody>
<tr v-for="(index, task) in list">
<td><input type="checkbox" id="checkbox" aria-label="checkbox" value="checkbox"></td>
<td>@{{ index + 1 }}</td>
<td>@{{ task.religion | capitalize }}</td>
<td v-if="task.status == 'publish'">
<span class="glyphicon glyphicon-ok"></span>
</td>
<td v-else>
<span class="glyphicon glyphicon-remove"></span>
</td>
<td>@{{ task.created_at }}</td>
<td>
<span class="glyphicon glyphicon-pencil" aria-hidden="true" data-toggle="tooltip" data-placement="left" title="Edit"></span>
<span class="glyphicon glyphicon-trash" aria-hidden="true" data-toggle="tooltip" data-placement="right" title="Delete"></span>
</td>
</tr>
</tbody>
</table>
</template>
<tasks></tasks>
@push('scripts')
<script src="/js/script.js"></script>
@endpush
scripts.js
$(function() {
$('[data-toggle="tooltip"]').tooltip()
})
Vue.component('tasks', {
template: '#tasks-template',
data: function(){
return{
list: []
};
},
created: function(){
this.fetchTaskList();
},
methods: {
fetchTaskList: function(){
this.$http.get('/backend/religion/data', function(tasks){
this.$set('list', tasks);
});
}
}
});
new Vue({
el: 'body'
});
vue-strap có chú giải công cụ – vbranden
@vbranden Vì vậy, không có dây đeo vue, điều này là không thể? –
tất nhiên là có thể. tôi chỉ đơn giản có nghĩa là bạn có thể sử dụng dây đeo vue hoặc xem mã nguồn để xem cách tự mình làm như thế nào – vbranden