@jx3box/jx3box-ui 2.3.13 → 2.3.14
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
package/src/filters/clientBy.vue
CHANGED
|
@@ -36,6 +36,10 @@ export default {
|
|
|
36
36
|
type: Boolean,
|
|
37
37
|
default: false,
|
|
38
38
|
},
|
|
39
|
+
autoDetect: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: true,
|
|
42
|
+
},
|
|
39
43
|
},
|
|
40
44
|
data: function () {
|
|
41
45
|
return {
|
|
@@ -57,6 +61,11 @@ export default {
|
|
|
57
61
|
return this.clients || clients;
|
|
58
62
|
},
|
|
59
63
|
},
|
|
64
|
+
watch: {
|
|
65
|
+
type: function (value) {
|
|
66
|
+
this.client = value || "";
|
|
67
|
+
},
|
|
68
|
+
},
|
|
60
69
|
methods: {
|
|
61
70
|
filter: function (val) {
|
|
62
71
|
this.client = val;
|
|
@@ -65,11 +74,9 @@ export default {
|
|
|
65
74
|
},
|
|
66
75
|
},
|
|
67
76
|
mounted: function () {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
this.filter(this.client);
|
|
72
|
-
}
|
|
77
|
+
if (!this.autoDetect) return;
|
|
78
|
+
const client = location.hostname.includes("origin") ? "origin" : "std";
|
|
79
|
+
this.filter(client);
|
|
73
80
|
},
|
|
74
81
|
};
|
|
75
82
|
</script>
|
|
@@ -52,6 +52,7 @@ export const Default = {
|
|
|
52
52
|
{ name: 'type / value', type: 'String', default: '""', description: '当前激活项。' },
|
|
53
53
|
{ name: 'clients', type: 'Object', default: 'null', description: 'clientBy 自定义客户端列表。' },
|
|
54
54
|
{ name: 'showWujie', type: 'Boolean', default: 'false', description: 'clientBy 是否展示无界。' },
|
|
55
|
+
{ name: 'autoDetect', type: 'Boolean', default: 'true', description: '是否在挂载时根据站点 hostname 自动选择客户端;受控场景传 false。' },
|
|
55
56
|
],
|
|
56
57
|
},
|
|
57
58
|
{
|
|
@@ -17,6 +17,7 @@ export const Default = {
|
|
|
17
17
|
{ name: 'type', type: 'String', default: '""', description: '当前选中的客户端值。' },
|
|
18
18
|
{ name: 'clients', type: 'Object', default: 'null', description: '自定义客户端映射。' },
|
|
19
19
|
{ name: 'showWujie', type: 'Boolean', default: 'false', description: '是否显示无界。' },
|
|
20
|
+
{ name: 'autoDetect', type: 'Boolean', default: 'true', description: '是否根据站点 hostname 自动选择客户端;受控场景传 false。' },
|
|
20
21
|
] };
|
|
21
22
|
},
|
|
22
23
|
template: `<div style="display:grid;gap:24px;"><section style="border-radius:20px;background:rgba(255,255,255,0.92);padding:24px;box-shadow:0 24px 60px rgba(15,23,42,0.08);"><clientBy :show-wujie="true" /></section><StoryPropsTable title="clientBy" description="客户端筛选组件。" :items="propsInfo" /></div>`,
|