【发布时间】:2016-07-24 01:42:43
【问题描述】:
你好吗?希望一切顺利!
所以我在 ThemeForest 有一个模板(纯 HTML + CSS + jQuery),我正在用 Vue.js + Laravel 开发应用程序。
当我必须在 Bootstrap Modal 中使用 2 个插件(一个是 Bootstrap 工具提示,另一个是 Switchery)时,我遇到了一个问题。
我希望保持原样,因为我不希望更改模板 =)
当我将它放在视图组件中时,它根本不起作用!有我的代码,如果有人可以帮忙!
OBS:我使上面的代码比真正的代码更简洁,我正在使用 VUEIFY,我认为这不是问题!
按钮触发模式
<a href="#" data-toggle="modal" data-target="#sources-modal">My Modal</a>
我的模式代码
<template>
<!-- Source -->
<div id="sources-modal" class="modal fade" style="display: none;">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Sources</h4>
</div>
<div class="modal-body">
<div class="row p-10">
<div class="col-md-6 m_md_bottom_15">
<span class="waves-effect btn btn-warning" data-toggle="tooltip" data-original-title="Refresh" @click="fetchRecordList()"><i class="fa fa-refresh"></i></span>
</div>
</div>
<div class="over_auto" v-el:data-grid>
<table class="table table-striped table-bordered m-0">
<thead>
<tr>
<th class="w_50">
<input @click="selectAll()" v-model="allSelected" type="checkbox">
</th>
<th class="th_sort" @click="sort('name')" :class="isSortedColumn('name')">Name</th>
<th class="t_center th_sort w_100" @click="sort('active')" :class="isSortedColumn('active')">Active</th>
<th class="t_center w_100">Actions</th>
</tr>
</thead>
<tbody>
<tr v-for="r in list | filterBy tableFilter | orderBy sortProperty sortDirection" track-by="$index">
<td>
<input type="checkbox" v-model="selected" value="{{ r.id }}">
</td>
<td>{{ r.name }}</td>
<td class="t_center">
<input type="checkbox" data-plugin="switchery" data-color="#5fbeaa" data-size="small" v-model="r.active" />
</td>
<td class="t_center">
<span class="waves-effect btn btn-warning btn-xs" data-toggle="tooltip" title="Edit" @click="fillForm(r)"><i class="fa-fw fa fa-pencil"></i></span>
<span class="waves-effect btn btn-danger btn-xs" data-toggle="tooltip" title="Delete" @click="deleteRecord(r)"><i class="fa-fw fa fa-times"></i></span>
</td>
</tr>
<tr v-show="!list.length">
<td class="t_center" colspan="4">No records found</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</template>
在这里,我从 MODAL 中提取了工具提示和切换代码以便更轻松地展示它
<input type="checkbox" data-plugin="switchery" data-color="#5fbeaa" data-size="small" v-model="r.active" />
<span class="waves-effect btn btn-warning" data-toggle="tooltip" data-original-title="Refresh" @click="fetchRecordList()"><i class="fa fa-refresh"></i></span>
有人知道如何帮助我吗?
提前致谢!
【问题讨论】:
标签: javascript jquery tooltip vue.js switchery