Wie kann man add bootstrap tooltip im Vue Js

Habe ich eine Seite für die Auflistung der Daten aus Tabelle mit VueJs und Laravel. Auflistung der Daten erfolgreich ist. Löschen und Bearbeiten-Funktion auf. Für diesen Zweck habe ich zwei <span> (glyphicon-pencil), <span> (glyphicon-trash). Wenn beide <span> sind außerhalb der <template>tooltip zeigt an, sonst funktioniert das nicht. Wissen Sie, wie bootstrap tooltip funktioniert innerhalb Vue Js. Danke.

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 mit tooltips
Also ohne vue Armband das nicht möglich?
natürlich, das ist möglich. ich habe meinen einfach Sie können entweder vue-Gurt oder den Quellcode anschauen, um zu sehen, wie es selbst zu tun

InformationsquelleAutor sam sam | 2016-05-06

Schreibe einen Kommentar