@gonsin/gview 1.1.2 → 1.1.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/README.md +85 -7
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# GView
|
|
2
2
|
|
|
3
|
+
GView 项目的前端部分,接收处理来自服务器的 JSON 格式数据快速生成对应的表单、表格等视图。
|
|
4
|
+
|
|
3
5
|
<a href="https://www.npmjs.com/package/@gonsin/gview">
|
|
4
6
|
<img src="https://img.shields.io/npm/v/@gonsin/gview.svg?sanitize=true" alt="Version">
|
|
5
7
|
</a>
|
|
6
8
|
|
|
7
|
-
GView 项目的前端部分,接收处理来自服务器的 JSON 格式数据快速生成对应的表单、表格等视图。
|
|
8
|
-
|
|
9
9
|
## 安装依赖
|
|
10
10
|
|
|
11
11
|
```sh
|
|
@@ -30,7 +30,7 @@ npm run build
|
|
|
30
30
|
npm publish
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
##
|
|
33
|
+
## `example` 项目运行
|
|
34
34
|
|
|
35
35
|
```sh
|
|
36
36
|
cd example
|
|
@@ -42,10 +42,14 @@ npm run serve
|
|
|
42
42
|
|
|
43
43
|
详细参考 `example` 项目。
|
|
44
44
|
|
|
45
|
-
`main.js` 配置:
|
|
45
|
+
1. 项目入口文件 `main.js` 配置:
|
|
46
46
|
|
|
47
47
|
```js
|
|
48
|
-
|
|
48
|
+
import store from "./store";
|
|
49
|
+
|
|
50
|
+
import TDesign from "tdesign-vue";
|
|
51
|
+
Vue.use(TDesign);
|
|
52
|
+
|
|
49
53
|
import GView from "@gonsin/gview";
|
|
50
54
|
Vue.use(GView, { store });
|
|
51
55
|
|
|
@@ -55,7 +59,9 @@ new Vue({
|
|
|
55
59
|
}).$mount("#app");
|
|
56
60
|
```
|
|
57
61
|
|
|
58
|
-
|
|
62
|
+
> 注意目前 GView 依赖于 TDesign,所以需要引入 TDesign;另外需要在 `Vue.use(GView, { store })` 中传入 `Vuex` 的 `store`,以便动态注册 GView 的 `store` 模块。
|
|
63
|
+
|
|
64
|
+
2. 根据开发修改代理服务的接口地址:
|
|
59
65
|
|
|
60
66
|
```js
|
|
61
67
|
proxy: {
|
|
@@ -79,9 +85,81 @@ proxy: {
|
|
|
79
85
|
|
|
80
86
|
```
|
|
81
87
|
|
|
82
|
-
|
|
88
|
+
3. 设置与 GView 相关的路由映射:
|
|
89
|
+
|
|
90
|
+
```js
|
|
91
|
+
const routes = [
|
|
92
|
+
{
|
|
93
|
+
path: "/view",
|
|
94
|
+
name: "home",
|
|
95
|
+
component: () => import("../views/HomeView.vue"),
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
path: "/login",
|
|
99
|
+
name: "login",
|
|
100
|
+
component: () => import("../views/LoginView.vue"),
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
redirect: "/login",
|
|
104
|
+
path: "/",
|
|
105
|
+
},
|
|
106
|
+
];
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
> 与 GView 路由组件相关的路由路径 `path` 必须设置为 `/view`;登录页面的路由路径必须设置为 `/login`;根据需求设置重定向以及路由守卫。具体参考 `example/src/router/index.js`。
|
|
110
|
+
|
|
111
|
+
4. `GView` 组件的具体用法:
|
|
112
|
+
|
|
113
|
+
```html
|
|
114
|
+
<template>
|
|
115
|
+
<GView :config="{ ...defaultConfig, ...config }" />
|
|
116
|
+
</template>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
> `:config` 传入用户登录信息以及登录权限菜单;另外可后续传入更多自定义配置。 具体参考 `example/src/views/HomeView.vue`。
|
|
120
|
+
|
|
121
|
+
5. 另外 GView 提供了已经封装好的 axios 工具,可以直接引入使用:
|
|
83
122
|
|
|
84
123
|
```js
|
|
85
124
|
// 引入提供的axios封装工具
|
|
86
125
|
import { http } from "@gonsin/gview";
|
|
87
126
|
```
|
|
127
|
+
|
|
128
|
+
## 版本更新日志
|
|
129
|
+
|
|
130
|
+
### 1.1.0 `2022-12-12`
|
|
131
|
+
|
|
132
|
+
- 使用 TypeScript + TDesign 重构项目代码,更换掉原来的组件库 ElementUI。
|
|
133
|
+
|
|
134
|
+
### 1.1.1 `2022-12-12`
|
|
135
|
+
|
|
136
|
+
- fix(7e6faa2): `GTab`/`GDialog` 修复 tab 和对话框动态加载组件出错问题
|
|
137
|
+
- fix(efe8365): `GForm`/`GTable` 修复 v 方法找不到导致动态渲染内容无法显示问题
|
|
138
|
+
- fix(e301593): `GLayout` 修复头部下拉框消失问题
|
|
139
|
+
- fix(840a93a): 修改打包构建配置
|
|
140
|
+
|
|
141
|
+
### 1.1.2 `2022-12-12`
|
|
142
|
+
|
|
143
|
+
- fix(06c7839): 修复 babel 依赖打包后报错问题
|
|
144
|
+
|
|
145
|
+
### 1.1.3 `2022-12-13`
|
|
146
|
+
|
|
147
|
+
- fix(f10e6e4): `GForm` 修改 TreeCheckBox 选中值模式包括父节点
|
|
148
|
+
- fix(c80791f): `GLayout` 修复切换 tab 菜单时丢失路径携带的参数导致页面空白的问题
|
|
149
|
+
- fix(f934526): `GTable` 完善表格视图的分页功能
|
|
150
|
+
- fix(9c90248): 完善路由守卫
|
|
151
|
+
|
|
152
|
+
### 1.14 `2022-12-16`
|
|
153
|
+
|
|
154
|
+
- fix(82e545e): 将登录后初始化用户信息及菜单等逻辑转入 GView 包内进行:
|
|
155
|
+
|
|
156
|
+
- 涉及 `example` 用法的更新,使用 GView 组件时传入用户登录后的信息、菜单即可
|
|
157
|
+
- 更加方便之后传入更多自定义的配置到 GView 中
|
|
158
|
+
|
|
159
|
+
- fix(8a3d5d9): 处理重复路由跳转报错
|
|
160
|
+
- feat(5373d6b): `GForm` 完善表单隐藏项目类型
|
|
161
|
+
- feat(b532d8e): `Auth` 完善传入的 token 以及在每个请求头中添加 token 字段
|
|
162
|
+
- fix(f1067bd): 修复刷新后回到首页问题
|
|
163
|
+
- fix(e25aa5a): 修改样式以及规范样式类命名
|
|
164
|
+
- fix(275d821): 解决打包时的变量丢失问题
|
|
165
|
+
- fix(3387471) 调整用户登录相关的逻辑
|