ol-base-components 1.0.2 → 1.2.0

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.0.2",
3
+ "version": "1.2.0",
4
4
  "private": false,
5
5
  "main": "src/package/index.js",
6
6
  "scripts": {
@@ -15,7 +15,7 @@
15
15
  "element-ui": "^2.15.14",
16
16
  "eslint": "^8.57.1",
17
17
  "eslint-plugin-vue": "^10.3.0",
18
- "swagger-client": "^3.35.6",
18
+ "swagger-client": "^3.0.1",
19
19
  "vue": "^2.6.14"
20
20
  },
21
21
  "devDependencies": {
@@ -1,7 +1,9 @@
1
1
  import OlTable from "./table";
2
2
  import OlSearch from "./formSearch";
3
3
  import Dialog from "./dialog";
4
- import Swagger from "../utils/swagger";
4
+ // import Swagger from "../utils/swagger";
5
+ import ElementUI from "element-ui";
6
+ import "element-ui/lib/theme-chalk/index.css";
5
7
  import SwaggerClient from "swagger-client";
6
8
 
7
9
  const consoleTooltip = () => {
@@ -35,12 +37,18 @@ export const SwaggerHandler = async (Vue) => {
35
37
 
36
38
  const components = [OlTable, OlSearch, Dialog];
37
39
 
38
- const install = function (Vue) {
39
- // if (option.swaggerUrl) {
40
- // // "http://220.179.249.140:20019/swagger/v1/swagger.json"
41
- // const swaggerInstance = new Swagger(option.swaggerUrl);
42
- // Vue.prototype.$swagger = swaggerInstance;
43
- // }
40
+ const install = function (
41
+ Vue,
42
+ options = {
43
+ swaggerUrl: "",
44
+ }
45
+ ) {
46
+ if (options && options.swaggerUrl) {
47
+ // "http://220.179.249.140:20019/swagger/v1/swagger.json"
48
+ const swaggerInstance = new Swagger(options.swaggerUrl);
49
+ Vue.prototype.$swagger = swaggerInstance;
50
+ }
51
+ Vue.use(ElementUI);
44
52
  // 遍历所有组件
45
53
  components.map((item) => {
46
54
  Vue.component(`ol-${item.name}`, item);
@@ -52,4 +60,4 @@ const install = function (Vue) {
52
60
  // 判断是否引入文件
53
61
  export default install; //全局导入
54
62
  export { OlTable, OlSearch, Dialog }; //按需导入
55
- export { Swagger };
63
+ // export { Swagger };