Fix running jQuery plugins

This commit is contained in:
Pig Fang 2018-07-31 09:16:56 +08:00
parent b1faa99a90
commit 0423bef836

View File

@ -3,3 +3,33 @@ import 'bootstrap';
import 'bootstrap-fileinput'; import 'bootstrap-fileinput';
import 'admin-lte'; import 'admin-lte';
import 'icheck'; import 'icheck';
import Vue from 'vue';
import swal from 'sweetalert2';
import { trans } from './i18n';
swal.setDefaults({
confirmButtonText: trans('general.confirm'),
cancelButtonText: trans('general.cancel')
});
Vue.mixin({
mounted() {
$(this.$el).iCheck({
radioClass: 'iradio_square-blue',
checkboxClass: 'icheckbox_square-blue'
}).on('ifChecked ifUnchecked', function () {
$(this)[0].dispatchEvent(new Event('change'));
});
$('[data-toggle="tooltip"]').tooltip();
}
});
$(document).ready(() => {
$('input').iCheck({
radioClass: 'iradio_square-blue',
checkboxClass: 'icheckbox_square-blue'
});
$('[data-toggle="tooltip"]').tooltip();
});