| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- import "@vci/style";
- import App from "./App";
- import { adapt } from "../../other/adapt";
- import VciLoading from "./components/other/VpLoading/VciLoading.vue";
- import { PluginLoading } from "./components/other/VpLoading";
- import { PluginNotification } from "./components/other/VpNotification";
- import VciNotification from "./components/other/VpNotification/VciNotification.vue";
- import FilterIcu from "./filters/filter.icu";
- import { PluginPopupQuick } from "./components/popup/PopupQuick";
- import MixinData from "./mixins/MixinData";
- import DirectiveSilky from "./directives/Silky";
- import DirectiveTooltip from "./directives/Tooltip";
- import { PluginPopupWindow } from "./components/popup/PopupWindow";
- /**
- * 初始化Vue
- * @param Vue Vue类
- * @param option Vue初始化配置
- * @param pkg package.json
- * @return vm
- */
- export default function VciInit(Vue, option = {}, pkg = {}) {
- // 常用过滤器
- Vue.use(FilterIcu);
- // 加载业务逻辑
- DirectiveSilky(Vue);
- // Tooltip
- DirectiveTooltip(Vue);
- // 弹框
- Vue.use(PluginPopupQuick);
- // 弹框(窗口)
- Vue.use(PluginPopupWindow);
- // 加载状态
- Vue.use(PluginLoading, { component: VciLoading });
- // 通知
- Vue.use(PluginNotification, { component: VciNotification });
- // 模块数据
- Vue.mixin(MixinData);
- // 实例化Vue
- Vue.config.productionTip = false;
- const vm = new Vue({
- render: h => h(App),
- ...option
- }).$mount("#app");
- // 屏幕适配
- adapt(pkg, vm);
- return vm;
- }
|