ol-base-components 1.2.2 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ol-base-components",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "private": false,
5
5
  "main": "src/package/index.js",
6
6
  "scripts": {
package/src/main.js CHANGED
@@ -10,8 +10,6 @@ import App from "./App.vue";
10
10
  // Vue.config.productionTip = false;
11
11
  Vue.use(ElementUI);
12
12
 
13
- setTimeout(() => {
14
- new Vue({
15
- render: (h) => h(App),
16
- }).$mount("#app");
17
- }, 20000);
13
+ new Vue({
14
+ render: (h) => h(App),
15
+ }).$mount("#app");
@@ -24,36 +24,33 @@ ${cyan}感谢使用我们的组件库,期待你的精彩应用!${reset}
24
24
  `);
25
25
  };
26
26
 
27
- export const SwaggerHandler = async (Vue) => {
28
- const client = await new SwaggerClient(
29
- "http://220.179.249.140:20019/swagger/v1/swagger.json"
30
- );
27
+ export const SwaggerHandler = async (Vue, swaggerUrl) => {
28
+ const client = await new SwaggerClient(swaggerUrl);
31
29
  console.log("client", client);
32
30
  Vue.prototype.$swagger = { specification: client.spec };
33
31
  };
34
32
 
35
33
  const components = [OlTable, OlSearch, Dialog];
36
34
 
37
- const install = function (
35
+ const install = async function (
38
36
  Vue,
39
37
  options = {
40
38
  swaggerUrl: "",
41
39
  }
42
40
  ) {
43
- if (options && options.swaggerUrl) {
44
- // "http://220.179.249.140:20019/swagger/v1/swagger.json"
45
- const client = new SwaggerClient(options.swaggerUrl);
46
- Vue.prototype.$swagger = { specification: client.spec };
47
- }
48
41
  // 遍历所有组件
49
42
  components.map((item) => {
50
43
  Vue.component(`ol-${item.name}`, item);
51
44
  });
52
45
 
46
+ if (options && options.swaggerUrl) {
47
+ // "http://220.179.249.140:20019/swagger/v1/swagger.json"
48
+ const client = await new SwaggerClient(options.swaggerUrl);
49
+ Vue.prototype.$swagger = { specification: client.spec };
50
+ }
53
51
  consoleTooltip();
54
52
  };
55
53
 
56
54
  // 判断是否引入文件
57
55
  export default install; //全局导入
58
56
  export { OlTable, OlSearch, Dialog }; //按需导入
59
- // export { Swagger };