clickgo 3.11.27 → 3.11.28
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 +1 -1
- package/dist/app/demo/form/control/flow/flow.xml +1 -1
- package/dist/app/demo/form/control/html/html.js +1 -0
- package/dist/app/demo/form/control/html/html.xml +9 -4
- package/dist/clickgo.ts +1 -1
- package/dist/control/markdownit.cgc +0 -0
- package/dist/lib/tool.ts +17 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Load the module loader first, and then load it using the module loader.
|
|
|
28
28
|
**index.html**
|
|
29
29
|
|
|
30
30
|
```html
|
|
31
|
-
<script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.5.1/dist/loader.min.js?path=index&npm={'clickgo':'3.11.
|
|
31
|
+
<script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.5.1/dist/loader.min.js?path=index&npm={'clickgo':'3.11.28'}"></script>
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
**index.js**
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
<!-- button list -->
|
|
41
41
|
<layout gutter="10">
|
|
42
42
|
<select v-model="lineValue" :data="[10, 50, 500, 5000]" style="flex: 1; width: 0;"></select>
|
|
43
|
-
<button @click="lineCount += parseInt(lineValue[0])" style="height: 30px;padding: 0 10px;">Add lines</button>
|
|
43
|
+
<button @click="lineCount += parseInt(lineValue[0])" style="height: 30px; padding: 0 10px;">Add lines</button>
|
|
44
44
|
<button @click="lineCount -= parseInt(lineValue[0]);if(lineCount < 0) {lineCount = 0;}" style="height: 30px; padding: 0 10px;">Remove lines</button>
|
|
45
45
|
</layout>
|
|
46
46
|
<layout gutter="10">
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
<form title="Html" width="450" height="500" padding="10">
|
|
2
2
|
<layout gutter="10" direction="v" style="flex: 1; width: 0;">
|
|
3
|
-
<layout gutter="10" style="flex: 1; height: 0;">
|
|
4
|
-
<html :html="html[htmlIndex]" :css="lcss" style="background: var(--g-plain-background); border: solid 1px var(--g-plain-border-color); padding: 10px; flex: 1; width: 0;"></html>
|
|
5
|
-
<html :html="html[htmlIndex]" :css="rcss" style="background: var(--g-plain-background); border: solid 1px var(--g-plain-border-color); padding: 10px; flex: 1; width: 0;"></html>
|
|
6
|
-
</layout>
|
|
7
3
|
<layout gutter="10">
|
|
8
4
|
<button style="flex: 1;" @click="lcss = lcss ? '' : css">Left {{lcss ? 'remove' : 'add'}} css</button>
|
|
9
5
|
<button style="flex: 1;" @click="htmlIndex = htmlIndex ? 0 : 1">Toogle html</button>
|
|
6
|
+
<button style="flex: 1;" @click="adaptation = !adaptation">{{adaptation ? '' : '!'}}Adaptation</button>
|
|
10
7
|
<button style="flex: 1;" @click="rcss = rcss ? '' : css">Right {{rcss ? 'remove' : 'add'}} css</button>
|
|
11
8
|
</layout>
|
|
9
|
+
<layout gutter="10" style="flex: 1; height: 0;">
|
|
10
|
+
<flow direction="v" style="flex: 1;">
|
|
11
|
+
<html :html="html[htmlIndex]" :css="lcss" style="background: var(--g-plain-background); border: solid 1px var(--g-plain-border-color); padding: 10px;" :style="{'flex': adaptation ? undefined : '1'}"></html>
|
|
12
|
+
</flow>
|
|
13
|
+
<flow direction="v" style="flex: 1;">
|
|
14
|
+
<html :html="html[htmlIndex]" :css="rcss" style="background: var(--g-plain-background); border: solid 1px var(--g-plain-border-color); padding: 10px;" :style="{'flex': adaptation ? undefined : '1'}"></html>
|
|
15
|
+
</flow>
|
|
16
|
+
</layout>
|
|
12
17
|
</layout>
|
|
13
18
|
</form>
|
package/dist/clickgo.ts
CHANGED
|
Binary file
|
package/dist/lib/tool.ts
CHANGED
|
@@ -802,6 +802,23 @@ export function post(url: string, data: Record<string, any> | FormData, opt?: {
|
|
|
802
802
|
return loader.post(url, data, opt);
|
|
803
803
|
}
|
|
804
804
|
|
|
805
|
+
/** --- 发送响应为 json 的网络数据,无需 try,失败返回 null --- */
|
|
806
|
+
export async function postResponseJson(url: string, data: Record<string, any> | FormData, opt?: {
|
|
807
|
+
'credentials'?: 'include' | 'same-origin' | 'omit';
|
|
808
|
+
'headers'?: HeadersInit;
|
|
809
|
+
}): Promise<any | null> {
|
|
810
|
+
const res = await loader.post(url, data, opt);
|
|
811
|
+
if (!res) {
|
|
812
|
+
return null;
|
|
813
|
+
}
|
|
814
|
+
try {
|
|
815
|
+
return await res.json();
|
|
816
|
+
}
|
|
817
|
+
catch {
|
|
818
|
+
return null;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
|
|
805
822
|
export function parseUrl(url: string): ILoaderUrl {
|
|
806
823
|
return loader.parseUrl(url);
|
|
807
824
|
}
|