Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import OurVue from 'vue';
  2. import application from './mixins/application';
  3. import breakpoint from './mixins/breakpoint';
  4. import theme from './mixins/theme';
  5. import icons from './mixins/icons';
  6. import options from './mixins/options';
  7. import genLang from './mixins/lang';
  8. import goTo from './goTo';
  9. // Utils
  10. import { consoleWarn, consoleError } from '../../util/console';
  11. var Vuetify = {
  12. install: function install(Vue) {
  13. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  14. if (this.installed) return;
  15. this.installed = true;
  16. if (OurVue !== Vue) {
  17. consoleError('Multiple instances of Vue detected\nSee https://github.com/vuetifyjs/vuetify/issues/4068\n\nIf you\'re seeing "$attrs is readonly", it\'s caused by this');
  18. }
  19. checkVueVersion(Vue);
  20. var lang = genLang(opts.lang);
  21. Vue.prototype.$vuetify = new Vue({
  22. mixins: [breakpoint(opts.breakpoint)],
  23. data: {
  24. application: application,
  25. dark: false,
  26. icons: icons(opts.iconfont, opts.icons),
  27. lang: lang,
  28. options: options(opts.options),
  29. rtl: opts.rtl,
  30. theme: theme(opts.theme)
  31. },
  32. methods: {
  33. goTo: goTo,
  34. t: lang.t.bind(lang)
  35. }
  36. });
  37. if (opts.directives) {
  38. for (var name in opts.directives) {
  39. Vue.directive(name, opts.directives[name]);
  40. }
  41. }
  42. (function registerComponents(components) {
  43. if (components) {
  44. for (var key in components) {
  45. var component = components[key];
  46. if (component && !registerComponents(component.$_vuetify_subcomponents)) {
  47. Vue.component(key, component);
  48. }
  49. }
  50. return true;
  51. }
  52. return false;
  53. })(opts.components);
  54. },
  55. version: '1.5.12'
  56. };
  57. export function checkVueVersion(Vue, requiredVue) {
  58. var vueDep = requiredVue || '^2.5.18';
  59. var required = vueDep.split('.', 3).map(function (v) {
  60. return v.replace(/\D/g, '');
  61. }).map(Number);
  62. var actual = Vue.version.split('.', 3).map(function (n) {
  63. return parseInt(n, 10);
  64. });
  65. // Simple semver caret range comparison
  66. var passes = actual[0] === required[0] && ( // major matches
  67. actual[1] > required[1] || // minor is greater
  68. actual[1] === required[1] && actual[2] >= required[2] // or minor is eq and patch is >=
  69. );
  70. if (!passes) {
  71. consoleWarn('Vuetify requires Vue version ' + vueDep);
  72. }
  73. }
  74. export default Vuetify;
  75. //# sourceMappingURL=index.js.map