clickgo 3.1.10-beta → 3.1.11-beta2

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 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.4.9/dist/loader.min.js?path=index&npm={'clickgo':'3.1.10-beta'}"></script>
31
+ <script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.4.9/dist/loader.min.js?path=index&npm={'clickgo':'3.1.11-beta2'}"></script>
32
32
  ```
33
33
 
34
34
  **index.js**
@@ -37,12 +37,12 @@ class default_1 extends clickgo.form.AbstractForm {
37
37
  constructor() {
38
38
  super(...arguments);
39
39
  this.layer = false;
40
- this.label = '';
40
+ this.name = '';
41
41
  this.isShow = false;
42
42
  this.loading = false;
43
43
  }
44
44
  onMounted() {
45
- this.watch('label', () => __awaiter(this, void 0, void 0, function* () {
45
+ this.watch('name', () => __awaiter(this, void 0, void 0, function* () {
46
46
  this.loading = true;
47
47
  yield clickgo.tool.sleep(300);
48
48
  this.loading = false;
@@ -1,5 +1,5 @@
1
1
  <form width="600" height="500" title="Nav" :loading="loading">
2
- <nav v-model="label" v-model:show="isShow" @layer="layer = $event" style="flex: 1; width: 0;">
2
+ <nav v-model="name" v-model:show="isShow" @layer="layer = $event" style="flex: 1; width: 0;">
3
3
  <nav-item label="Title1">
4
4
  <nav-title>group1</nav-title>
5
5
  <nav-item label="Sub1">
@@ -29,14 +29,20 @@
29
29
  <nav-item label="Action11"></nav-item>
30
30
  <nav-item label="Action12"></nav-item>
31
31
  </nav-item>
32
+ <nav-item label="中文">
33
+ <nav-item label="中文1"></nav-item>
34
+ <nav-item label="中文2"></nav-item>
35
+ <nav-item label="有 name" name="hasname"></nav-item>
36
+ </nav-item>
32
37
  </nav-item>
33
38
  <template v-slot:content>
34
39
  <layout direction="v" gutter="10" style="padding: 10px; flex: 1;">
35
40
  <label>Change the size of the form to see the effect.</label>
36
- <label>Now select: {{label}}</label>
41
+ <label>Now select: {{name}}</label>
37
42
  <label>Layer show: {{isShow ? 'true' : 'false'}}</label>
38
43
  <button v-if="layer" @click="isShow = true" style="height: 30px;">Open</button>
39
- <button @click="label = 'Action11'" style="height: 30px;">Select "Action11"</button>
44
+ <button @click="name = 'Action11'" style="height: 30px;">Select "Action11"</button>
45
+ <button @click="name = 'hasname'" style="height: 30px;">Select "hasname"</button>
40
46
  </layout>
41
47
  </template>
42
48
  </nav>
@@ -59,5 +59,10 @@ class default_1 extends clickgo.form.AbstractForm {
59
59
  yield clickgo.form.dialog('No permission.');
60
60
  });
61
61
  }
62
+ getHash() {
63
+ return __awaiter(this, void 0, void 0, function* () {
64
+ yield clickgo.form.dialog('Hash is: ' + clickgo.core.getHash());
65
+ });
66
+ }
62
67
  }
63
68
  exports.default = default_1;
@@ -8,5 +8,6 @@
8
8
  <text v-model="hash" style="flex: 1;" />
9
9
  <button @click="hashe" style="height: 30px; padding: 0 10px;">hash('{{hash}}')</button>
10
10
  </layout>
11
+ <button @click="getHash" style="height: 30px;">getHash()</button>
11
12
  </layout>
12
13
  </form>
Binary file
package/dist/lib/core.js CHANGED
@@ -32,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
32
32
  });
33
33
  };
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.hash = exports.getAvailArea = exports.fetchApp = exports.readApp = exports.trigger = exports.getModule = exports.regModule = exports.boot = exports.getCdn = exports.AbstractApp = exports.config = void 0;
35
+ exports.getHash = exports.hash = exports.getAvailArea = exports.fetchApp = exports.readApp = exports.trigger = exports.getModule = exports.regModule = exports.boot = exports.getCdn = exports.AbstractApp = exports.config = void 0;
36
36
  const clickgo = __importStar(require("../clickgo"));
37
37
  const fs = __importStar(require("./fs"));
38
38
  const form = __importStar(require("./form"));
@@ -680,6 +680,10 @@ function hash(hash, taskId) {
680
680
  return true;
681
681
  }
682
682
  exports.hash = hash;
683
+ function getHash() {
684
+ return window.location.hash ? decodeURIComponent(window.location.hash.slice(1)) : '';
685
+ }
686
+ exports.getHash = getHash;
683
687
  window.addEventListener('hashchange', function () {
684
- trigger('hashChanged', window.location.hash ? window.location.hash.slice(1) : '');
688
+ trigger('hashChanged', window.location.hash ? decodeURIComponent(window.location.hash.slice(1)) : '');
685
689
  });
package/dist/lib/core.ts CHANGED
@@ -786,6 +786,13 @@ export function hash(hash: string, taskId?: number): boolean {
786
786
  return true;
787
787
  }
788
788
 
789
+ /**
790
+ * --- 获取当前浏览器的 hash ---
791
+ */
792
+ export function getHash(): string {
793
+ return window.location.hash ? decodeURIComponent(window.location.hash.slice(1)) : '';
794
+ }
795
+
789
796
  window.addEventListener('hashchange', function() {
790
- trigger('hashChanged', window.location.hash ? window.location.hash.slice(1) : '');
797
+ trigger('hashChanged', window.location.hash ? decodeURIComponent(window.location.hash.slice(1)) : '');
791
798
  });
package/dist/lib/task.js CHANGED
@@ -236,7 +236,7 @@ function run(url, opt = {}, ntid) {
236
236
  const unblock = opt.unblock ? tool.clone(opt.unblock) : [];
237
237
  const unblockSys = [
238
238
  'require',
239
- '__awaiter', 'eval', 'Math', 'Array', 'Blob', 'Error', 'Infinity', 'parseInt', 'parseFloat', 'Promise', 'Date', 'JSON', 'fetch', 'Number', 'Object'
239
+ '__awaiter', 'eval', 'Math', 'Array', 'Blob', 'Error', 'Infinity', 'parseInt', 'parseFloat', 'Promise', 'Date', 'JSON', 'fetch', 'Number', 'Object', 'encodeURIComponent', 'decodeURIComponent'
240
240
  ];
241
241
  for (const name of unblockSys) {
242
242
  if (unblock.includes(name)) {
@@ -412,6 +412,9 @@ function run(url, opt = {}, ntid) {
412
412
  },
413
413
  hash: function (hash) {
414
414
  return core.hash(hash, taskId);
415
+ },
416
+ getHash: function () {
417
+ return core.getHash();
415
418
  }
416
419
  },
417
420
  'dom': {
package/dist/lib/task.ts CHANGED
@@ -282,7 +282,7 @@ export async function run(url: string, opt: types.ITaskRunOptions = {}, ntid?: n
282
282
  const unblock = opt.unblock ? tool.clone(opt.unblock) : [];
283
283
  const unblockSys = [
284
284
  'require',
285
- '__awaiter', 'eval', 'Math', 'Array', 'Blob', 'Error', 'Infinity', 'parseInt', 'parseFloat', 'Promise', 'Date', 'JSON', 'fetch', 'Number', 'Object'
285
+ '__awaiter', 'eval', 'Math', 'Array', 'Blob', 'Error', 'Infinity', 'parseInt', 'parseFloat', 'Promise', 'Date', 'JSON', 'fetch', 'Number', 'Object', 'encodeURIComponent', 'decodeURIComponent'
286
286
  ];
287
287
  for (const name of unblockSys) {
288
288
  if (unblock.includes(name)) {
@@ -470,6 +470,9 @@ export async function run(url: string, opt: types.ITaskRunOptions = {}, ntid?: n
470
470
  },
471
471
  hash: function(hash: string): boolean {
472
472
  return core.hash(hash, taskId);
473
+ },
474
+ getHash: function(): string {
475
+ return core.getHash();
473
476
  }
474
477
  },
475
478
  'dom': {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clickgo",
3
- "version": "3.1.10-beta",
3
+ "version": "3.1.11-beta2",
4
4
  "description": "Background interface, software interface, mobile phone APP interface operation library.",
5
5
  "keywords": [
6
6
  "deskrt",