sur-onlyoffice 1.0.4 → 1.0.5
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/dist/onlyoffice.es.js +14 -12
- package/dist/onlyoffice.umd.js +7 -7
- package/package.json +1 -1
- package/src/index.ts +6 -4
- package/src/package/index.ts +11 -0
package/dist/onlyoffice.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as O, ref as w, onMounted as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as O, ref as w, onMounted as k, onBeforeUnmount as A, createElementBlock as N, openBlock as x, createCommentVNode as L, createElementVNode as S } from "vue";
|
|
2
|
+
const P = { class: "onlyoffice-box" }, f = "https://test.xuandou.vip:126", v = "https://badges-1302420147.cos.ap-shanghai.myqcloud.com/test1.docx", Y = "asc.{91EAC419-EF8B-440C-A960-B451C7DF3A37}", B = /* @__PURE__ */ O({
|
|
3
3
|
__name: "onlyoffice",
|
|
4
|
-
setup(
|
|
4
|
+
setup(R) {
|
|
5
5
|
let i = null;
|
|
6
6
|
const c = w(!1), d = f + "/web-apps/apps/api/documents/api.js", g = f + "/8.3.1-10ca0f5dd35a63800b6a3956f350bf95/sdkjs-plugins/example_extended_comments/config.json";
|
|
7
7
|
function m() {
|
|
@@ -36,7 +36,7 @@ const v = { class: "onlyoffice-box" }, f = "https://test.xuandou.vip:126", Y = "
|
|
|
36
36
|
document: {
|
|
37
37
|
fileType: "docx",
|
|
38
38
|
title: "Demo.docx",
|
|
39
|
-
url:
|
|
39
|
+
url: v,
|
|
40
40
|
key: "test-key",
|
|
41
41
|
permissions: { edit: !0 }
|
|
42
42
|
},
|
|
@@ -47,7 +47,7 @@ const v = { class: "onlyoffice-box" }, f = "https://test.xuandou.vip:126", Y = "
|
|
|
47
47
|
user: { id: "u1", name: "Tester" },
|
|
48
48
|
plugins: {
|
|
49
49
|
//!
|
|
50
|
-
autostart: [
|
|
50
|
+
autostart: [Y],
|
|
51
51
|
pluginsData: [{ url: g + "?v=2.0." + Date.now() }]
|
|
52
52
|
// 强刷缓存
|
|
53
53
|
}
|
|
@@ -59,13 +59,13 @@ const v = { class: "onlyoffice-box" }, f = "https://test.xuandou.vip:126", Y = "
|
|
|
59
59
|
console.log("[ONLYOFFICE] 插件资源已加载,但不代表已初始化");
|
|
60
60
|
},
|
|
61
61
|
onDocumentReady: () => {
|
|
62
|
-
console.log("[ONLYOFFICE] 文档已就绪"),
|
|
62
|
+
console.log("[ONLYOFFICE] 文档已就绪"), b(), r(), console.log("window.Asc.plugin1", window?.Asc?.plugin), setTimeout(() => {
|
|
63
63
|
console.log("window.Asc.plugin2", window), console.log("window.Asc.plugin3-editor", i.serviceCommand), i.serviceCommand("event_onAddComment", { id: 111 });
|
|
64
64
|
}, 2e3);
|
|
65
65
|
},
|
|
66
66
|
onInfo: (n) => {
|
|
67
67
|
const t = n?.data;
|
|
68
|
-
console.log("[ONLYOFFICE] Info 事件:", n.data), n && (t?.command === "openPlugin" && (console.log("[ONLYOFFICE] openPlugin"), i.frame?.contentWindow?.Common?.Gateway?.sendInfo(t)), n.data.command === "pluginInitialized" && (c.value = !0, console.log("[ONLYOFFICE] 插件初始化完成"), r()), n.data.command === "pluginAck" && console.log("[ONLYOFFICE] 插件确认收到:", n.data), n.data.command === "pluginError" && console.error("[ONLYOFFICE] 插件错误:", n.data), n.data.command === "linkClicked" && (console.log("[ONLYOFFICE] 链接被点击,数据:", n.data.data),
|
|
68
|
+
console.log("[ONLYOFFICE] Info 事件:", n.data), n && (t?.command === "openPlugin" && (console.log("[ONLYOFFICE] openPlugin"), i.frame?.contentWindow?.Common?.Gateway?.sendInfo(t)), n.data.command === "pluginInitialized" && (c.value = !0, console.log("[ONLYOFFICE] 插件初始化完成"), r()), n.data.command === "pluginAck" && console.log("[ONLYOFFICE] 插件确认收到:", n.data), n.data.command === "pluginError" && console.error("[ONLYOFFICE] 插件错误:", n.data), n.data.command === "linkClicked" && (console.log("[ONLYOFFICE] 链接被点击,数据:", n.data.data), p(n.data.data)), n.data.command === "wordArtInserted" && (console.log("[ONLYOFFICE] WordArt 插入成功:", n.data.data), $(n.data.data)), n.data.command === "wordArtError" && (console.error("[ONLYOFFICE] WordArt 插入失败:", n.data.data), I(n.data.data)), n.data.command === "tableClicked" && (console.log("[ONLYOFFICE] 表格被点击,数据:", n.data.data), h(n.data.data)), n.data.command === "selectionAnalyzed" && (console.log("[ONLYOFFICE] 选中内容分析结果:", n.data.data), y(n.data.data)), n.data.command === "selectionBound" && (console.log("[ONLYOFFICE] 选中内容绑定完成:", n.data.data), D(n.data.data)), n.data.command === "bindingClicked" && (console.log("[ONLYOFFICE] 绑定控件被点击:", n.data.data), T(n.data.data)), n.data.command === "elementClicked" && (console.log("[ONLYOFFICE] 元素被点击:", n.data.data), C(n.data.data)), n.data.command === "preciseTableCellClicked" && (console.log("[ONLYOFFICE] 精确表格单元格被点击:", n.data.data), E(n.data.data)), n.data.command === "chartClicked" && (console.log("[ONLYOFFICE] 图表被点击:", n.data.data), F(n.data.data)));
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
};
|
|
@@ -73,7 +73,7 @@ const v = { class: "onlyoffice-box" }, f = "https://test.xuandou.vip:126", Y = "
|
|
|
73
73
|
console.log(n, "event123"), n.data.eventType === "customEventReplay" && console.info(n, "DDD1"), n.data.eventType === "customEventCommon" && console.info(n, "DDD2");
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function b() {
|
|
77
77
|
try {
|
|
78
78
|
i.executeCommand && i.executeCommand("focus"), console.log("123autoOpenPluginSidePanel", i), i.serviceCommand && i.serviceCommand("sidePanel", {
|
|
79
79
|
action: "toggle",
|
|
@@ -83,7 +83,7 @@ const v = { class: "onlyoffice-box" }, f = "https://test.xuandou.vip:126", Y = "
|
|
|
83
83
|
console.error("auto-open plugin failed:", o);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function p(o) {
|
|
87
87
|
console.log("处理链接点击事件,收到数据:", o), o && typeof o == "object" && (`${o.controlId || "unknown"}${o.controlTitle || "无标题"}${o.tag || "无Tag"}${JSON.stringify(o.data, null, 2)}${JSON.stringify(o, null, 2)}`, o.data && o.data.name && console.log("检测到用户名:", o.data.name));
|
|
88
88
|
}
|
|
89
89
|
function $(o) {
|
|
@@ -312,9 +312,9 @@ ${e.message}`, console.log("数据绑定成功,绑定信息:", e.binding);
|
|
|
312
312
|
} else
|
|
313
313
|
console.log("绑定控件点击检测失败或无绑定控件:", o?.error || "未知错误"), o?.data?.clickType === "non-binding" && console.log("当前点击位置不是绑定控件");
|
|
314
314
|
}
|
|
315
|
-
return
|
|
315
|
+
return k(() => u()), A(() => {
|
|
316
316
|
i?.destroyEditor && i.destroyEditor(), a !== null && clearInterval(a);
|
|
317
|
-
}), (o, e) => (x(), N("div",
|
|
317
|
+
}), (o, e) => (x(), N("div", P, [
|
|
318
318
|
L("", !0),
|
|
319
319
|
e[1] || (e[1] = S("div", {
|
|
320
320
|
id: "editor",
|
|
@@ -323,4 +323,6 @@ ${e.message}`, console.log("数据绑定成功,绑定信息:", e.binding);
|
|
|
323
323
|
]));
|
|
324
324
|
}
|
|
325
325
|
});
|
|
326
|
-
|
|
326
|
+
export {
|
|
327
|
+
B as onlyoffice
|
|
328
|
+
};
|
package/dist/onlyoffice.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(a
|
|
1
|
+
(function(l,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],a):(l=typeof globalThis<"u"?globalThis:l||self,a(l.OnlyofficeUI={},l.Vue))})(this,(function(l,a){"use strict";const u={class:"onlyoffice-box"},r="https://test.xuandou.vip:126",p="https://badges-1302420147.cos.ap-shanghai.myqcloud.com/test1.docx",b="asc.{91EAC419-EF8B-440C-A960-B451C7DF3A37}",$=a.defineComponent({__name:"onlyoffice",setup(S){let i=null;const s=a.ref(!1),f=r+"/web-apps/apps/api/documents/api.js",I=r+"/8.3.1-10ca0f5dd35a63800b6a3956f350bf95/sdkjs-plugins/example_extended_comments/config.json";function h(){return new Promise((o,e)=>{if(window.DocsAPI)return o();const n=document.createElement("script");n.src=f,n.onload=()=>o(),n.onerror=()=>e(new Error("加载 DocsAPI 失败:"+f)),document.head.appendChild(n)})}const g=[];let c=null;function m(){c===null&&(c=window.setInterval(()=>{if(!(!i||typeof i.serviceCommand!="function")&&s.value){for(;g.length;){const{cmd:o,payload:e}=g.shift();try{console.log("[ONLYOFFICE] 发送排队指令:",o,e),i.serviceCommand(o,e)}catch(n){console.error("[ONLYOFFICE] 队列指令发送失败:",o,n)}}c!==null&&(clearInterval(c),c=null)}},300))}async function y(){await h();const o=window.DocsAPI;i?.destroyEditor&&i.destroyEditor(),s.value=!1;const e={document:{fileType:"docx",title:"Demo.docx",url:p,key:"test-key",permissions:{edit:!0}},documentType:"word",editorConfig:{lang:"zh-CN",mode:"edit",user:{id:"u1",name:"Tester"},plugins:{autostart:[b],pluginsData:[{url:I+"?v=2.0."+Date.now()}]}},width:"100%",height:"100%",events:{onPluginsReady:()=>{console.log("[ONLYOFFICE] 插件资源已加载,但不代表已初始化")},onDocumentReady:()=>{console.log("[ONLYOFFICE] 文档已就绪"),D(),m(),console.log("window.Asc.plugin1",window?.Asc?.plugin),setTimeout(()=>{console.log("window.Asc.plugin2",window),console.log("window.Asc.plugin3-editor",i.serviceCommand),i.serviceCommand("event_onAddComment",{id:111})},2e3)},onInfo:n=>{const t=n?.data;console.log("[ONLYOFFICE] Info 事件:",n.data),n&&(t?.command==="openPlugin"&&(console.log("[ONLYOFFICE] openPlugin"),i.frame?.contentWindow?.Common?.Gateway?.sendInfo(t)),n.data.command==="pluginInitialized"&&(s.value=!0,console.log("[ONLYOFFICE] 插件初始化完成"),m()),n.data.command==="pluginAck"&&console.log("[ONLYOFFICE] 插件确认收到:",n.data),n.data.command==="pluginError"&&console.error("[ONLYOFFICE] 插件错误:",n.data),n.data.command==="linkClicked"&&(console.log("[ONLYOFFICE] 链接被点击,数据:",n.data.data),C(n.data.data)),n.data.command==="wordArtInserted"&&(console.log("[ONLYOFFICE] WordArt 插入成功:",n.data.data),T(n.data.data)),n.data.command==="wordArtError"&&(console.error("[ONLYOFFICE] WordArt 插入失败:",n.data.data),E(n.data.data)),n.data.command==="tableClicked"&&(console.log("[ONLYOFFICE] 表格被点击,数据:",n.data.data),F(n.data.data)),n.data.command==="selectionAnalyzed"&&(console.log("[ONLYOFFICE] 选中内容分析结果:",n.data.data),O(n.data.data)),n.data.command==="selectionBound"&&(console.log("[ONLYOFFICE] 选中内容绑定完成:",n.data.data),w(n.data.data)),n.data.command==="bindingClicked"&&(console.log("[ONLYOFFICE] 绑定控件被点击:",n.data.data),x(n.data.data)),n.data.command==="elementClicked"&&(console.log("[ONLYOFFICE] 元素被点击:",n.data.data),k(n.data.data)),n.data.command==="preciseTableCellClicked"&&(console.log("[ONLYOFFICE] 精确表格单元格被点击:",n.data.data),A(n.data.data)),n.data.command==="chartClicked"&&(console.log("[ONLYOFFICE] 图表被点击:",n.data.data),N(n.data.data)))}}};i=new o.DocEditor("editor",e),window.addEventListener("message",n=>{console.log(n,"event123"),n.data.eventType==="customEventReplay"&&console.info(n,"DDD1"),n.data.eventType==="customEventCommon"&&console.info(n,"DDD2")})}function D(){try{i.executeCommand&&i.executeCommand("focus"),console.log("123autoOpenPluginSidePanel",i),i.serviceCommand&&i.serviceCommand("sidePanel",{action:"toggle",state:!1})}catch(o){console.error("auto-open plugin failed:",o)}}function C(o){console.log("处理链接点击事件,收到数据:",o),o&&typeof o=="object"&&(`${o.controlId||"unknown"}${o.controlTitle||"无标题"}${o.tag||"无Tag"}${JSON.stringify(o.data,null,2)}${JSON.stringify(o,null,2)}`,o.data&&o.data.name&&console.log("检测到用户名:",o.data.name))}function T(o){if(console.log("WordArt 插入成功,数据:",o),o&&o.success){const e=`WordArt 插入成功!
|
|
2
2
|
|
|
3
3
|
文本: ${o.parameters?.text||"未知"}
|
|
4
4
|
字体大小: ${o.parameters?.fontSize||"未知"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
${o.message||""}`;confirm(e+`
|
|
9
9
|
|
|
10
|
-
点击"确定"可继续插入更多WordArt`)&&console.log("用户选择继续操作WordArt")}}function
|
|
10
|
+
点击"确定"可继续插入更多WordArt`)&&console.log("用户选择继续操作WordArt")}}function E(o){console.error("WordArt 插入失败,错误:",o),o?.error}function F(o){if(console.log("处理表格点击事件,收到数据:",o),o&&o.success&&o.data){const e=o.data;let n=`表格被点击!
|
|
11
11
|
|
|
12
12
|
`;e.clickType==="table"?(n+=`点击类型: 表格内容
|
|
13
13
|
`,n+=`表格索引: ${e.tableIndex>=0?e.tableIndex:"未知"}
|
|
@@ -25,7 +25,7 @@ ${o.message||""}`;confirm(e+`
|
|
|
25
25
|
`}),e.tableData.content.length>3&&(n+=`... 还有 ${e.tableData.content.length-3} 行
|
|
26
26
|
`)))):(n+=`点击类型: 非表格区域
|
|
27
27
|
`,n+=`点击时间: ${e.timestamp}
|
|
28
|
-
`),e.clickType==="table"&&e.tableData&&console.log("检测到表格点击,可以执行相关操作:",{tableIndex:e.tableIndex,tableData:e.tableData})}else console.log("表格点击检测失败:",o?.error||"未知错误")}function
|
|
28
|
+
`),e.clickType==="table"&&e.tableData&&console.log("检测到表格点击,可以执行相关操作:",{tableIndex:e.tableIndex,tableData:e.tableData})}else console.log("表格点击检测失败:",o?.error||"未知错误")}function O(o){if(console.log("处理选中内容分析结果,收到数据:",o),o&&o.success&&o.data){const e=o.data;let n=`选中内容分析结果!
|
|
29
29
|
|
|
30
30
|
`;n+=`选择类型: ${e.selectionType}
|
|
31
31
|
`,n+=`是否可绑定: ${e.bindable?"是":"否"}
|
|
@@ -35,7 +35,7 @@ ${o.message||""}`;confirm(e+`
|
|
|
35
35
|
`,e.suggestedBindings.slice(0,3).forEach((t,d)=>{n+=`${d+1}. ${t.description} (${t.category})
|
|
36
36
|
`}),e.suggestedBindings.length>3&&(n+=`... 还有 ${e.suggestedBindings.length-3} 种绑定方式
|
|
37
37
|
`)),n+=`
|
|
38
|
-
分析时间: ${e.timestamp}`,e.bindable&&console.log("内容可以绑定,建议绑定方式:",e.suggestedBindings)}else console.log("选中内容分析失败:",o?.error||"未知错误")}function
|
|
38
|
+
分析时间: ${e.timestamp}`,e.bindable&&console.log("内容可以绑定,建议绑定方式:",e.suggestedBindings)}else console.log("选中内容分析失败:",o?.error||"未知错误")}function w(o){if(console.log("处理选中内容绑定完成,收到数据:",o),o&&o.success){const e=o.data;let n=`数据绑定完成!
|
|
39
39
|
|
|
40
40
|
`;n+=`绑定方法: ${e.method}
|
|
41
41
|
`,n+=`绑定类型: ${e.binding?.type||"未知"}
|
|
@@ -43,7 +43,7 @@ ${o.message||""}`;confirm(e+`
|
|
|
43
43
|
`),e.binding.dataType&&(n+=`数据类型: ${e.binding.dataType}
|
|
44
44
|
`),e.binding.originalValue&&(n+=`原始值: "${e.binding.originalValue}"
|
|
45
45
|
`)),n+=`
|
|
46
|
-
${e.message}`,console.log("数据绑定成功,绑定信息:",e.binding)}else console.log("数据绑定失败:",o?.error||"未知错误")}function
|
|
46
|
+
${e.message}`,console.log("数据绑定成功,绑定信息:",e.binding)}else console.log("数据绑定失败:",o?.error||"未知错误")}function k(o){if(console.log("🎯 处理通用元素点击事件,收到数据:",o),o&&o.success&&o.data){const e=o.data;let n=`🎯 元素点击检测结果!
|
|
47
47
|
|
|
48
48
|
`;n+=`点击类型: ${e.clickType}
|
|
49
49
|
`,n+=`检测时间: ${e.timestamp}
|
|
@@ -86,7 +86,7 @@ ${e.message}`,console.log("数据绑定成功,绑定信息:",e.binding)}else c
|
|
|
86
86
|
`,n+=`- 总列数: ${e.tableInfo.totalColumns}
|
|
87
87
|
`,n+=`- 检测方法: ${e.detectionMethod}
|
|
88
88
|
`,n+=`- 检测时间: ${e.timestamp}
|
|
89
|
-
`,console.log("📊 精确单元格信息:",{row:e.cellPosition.row,column:e.cellPosition.column,content:e.cellContent,tableInfo:e.tableInfo}),e.cellPosition.row===1?console.log("🎯 点击了表头行,可以执行排序等操作"):console.log("🎯 点击了数据行,可以执行编辑等操作")}else console.log("❌ 精确表格单元格检测失败:",o?.error||"未知错误")}function
|
|
89
|
+
`,console.log("📊 精确单元格信息:",{row:e.cellPosition.row,column:e.cellPosition.column,content:e.cellContent,tableInfo:e.tableInfo}),e.cellPosition.row===1?console.log("🎯 点击了表头行,可以执行排序等操作"):console.log("🎯 点击了数据行,可以执行编辑等操作")}else console.log("❌ 精确表格单元格检测失败:",o?.error||"未知错误")}function N(o){if(console.log("📈 处理图表点击事件,收到数据:",o),o&&o.success&&o.data){const e=o.data;let n=`📈 图表点击检测结果!
|
|
90
90
|
|
|
91
91
|
`;if(n+=`点击类型: ${e.clickType}
|
|
92
92
|
`,n+=`检测时间: ${e.timestamp}
|
|
@@ -126,4 +126,4 @@ ${e.message}`,console.log("数据绑定成功,绑定信息:",e.binding)}else c
|
|
|
126
126
|
`,n+=`- 文档中图表总数: ${e.detectionSummary.totalChartsFound}
|
|
127
127
|
`,n+=`- 有数据的图表: ${e.detectionSummary.chartsWithData}
|
|
128
128
|
`,n+=`- 有选区: ${e.detectionSummary.hasSelection?"是":"否"}
|
|
129
|
-
`),console.log("📈 图表绑定数据:",e.boundData),e.boundData&&(e.boundData.type==="line-chart"?console.log("📈 这是线图,可以显示趋势分析"):e.boundData.type==="bar-chart"&&console.log("📊 这是柱状图,可以显示比较分析"),e.boundData.dataSource==="ERP系统"&&console.log("🔄 可以触发ERP系统数据刷新"))}else o&&o.success===!1&&console.log("❌ 图表检测失败或无图表:",o.error||"未知错误")}function
|
|
129
|
+
`),console.log("📈 图表绑定数据:",e.boundData),e.boundData&&(e.boundData.type==="line-chart"?console.log("📈 这是线图,可以显示趋势分析"):e.boundData.type==="bar-chart"&&console.log("📊 这是柱状图,可以显示比较分析"),e.boundData.dataSource==="ERP系统"&&console.log("🔄 可以触发ERP系统数据刷新"))}else o&&o.success===!1&&console.log("❌ 图表检测失败或无图表:",o.error||"未知错误")}function x(o){if(console.log("处理绑定控件点击事件,收到数据:",o),o&&o.success&&o.data){const e=o.data;let n="绑定控件被点击!\\n\\n";n+=`点击类型: ${e.clickType}\\n`,n+=`绑定类型: ${e.bindingType}\\n`,n+=`控件索引: ${e.controlIndex}\\n`,n+=`控件别名: ${e.controlAlias||"无"}\\n`,n+=`控件内容: "${e.controlContent||"空"}"\\n`,n+=`点击时间: ${e.timestamp}\\n`,e.bindingData&&(n+="\\n绑定数据详情:\\n",e.bindingType==="data-binding"?(n+=`- 字段名称: ${e.bindingData.fieldName}\\n`,n+=`- 数据类型: ${e.bindingData.dataType}\\n`,n+=`- 原始值: "${e.bindingData.originalValue}"\\n`,n+=`- 绑定时间: ${e.bindingData.boundAt}\\n`):e.bindingType==="template-variable"?(n+=`- 变量名: ${e.bindingData.variableName}\\n`,n+=`- 原始值: "${e.bindingData.originalValue}"\\n`,n+=`- 绑定时间: ${e.bindingData.boundAt}\\n`):e.bindingType==="table-data-binding"?(n+=`- 表格名称: ${e.bindingData.tableName}\\n`,n+=`- 绑定模式: ${e.bindingData.bindingMode}\\n`,n+=`- 绑定时间: ${e.bindingData.boundAt}\\n`):e.bindingType==="paragraph-template"?(n+=`- 模板名称: ${e.bindingData.templateName}\\n`,n+=`- 原始内容: "${e.bindingData.originalContent?.substring(0,50)}${e.bindingData.originalContent?.length>50?"...":""}"\\n`,n+=`- 绑定时间: ${e.bindingData.boundAt}\\n`):e.bindingType==="custom-binding"&&(n+=`- 自定义类型: ${e.bindingData.customType}\\n`,n+=`- 字段名称: ${e.bindingData.fieldName}\\n`,n+=`- 原始值: "${e.bindingData.originalValue}"\\n`,n+=`- 绑定时间: ${e.bindingData.boundAt}\\n`)),console.log("检测到绑定控件点击,可以执行相关操作:",{bindingType:e.bindingType,bindingData:e.bindingData}),e.bindingType==="data-binding"?console.log("数据字段绑定被点击,可以打开数据编辑界面"):e.bindingType==="template-variable"?console.log("模板变量绑定被点击,可以打开变量设置界面"):e.bindingType==="table-data-binding"&&console.log("表格数据源绑定被点击,可以打开数据源配置界面")}else console.log("绑定控件点击检测失败或无绑定控件:",o?.error||"未知错误"),o?.data?.clickType==="non-binding"&&console.log("当前点击位置不是绑定控件")}return a.onMounted(()=>y()),a.onBeforeUnmount(()=>{i?.destroyEditor&&i.destroyEditor(),c!==null&&clearInterval(c)}),(o,e)=>(a.openBlock(),a.createElementBlock("div",u,[a.createCommentVNode("",!0),e[1]||(e[1]=a.createElementVNode("div",{id:"editor",style:{flex:"1"}},null,-1))]))}});l.onlyoffice=$,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
// }
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
// 测试
|
|
10
|
+
// import { createApp } from 'vue'
|
|
11
|
+
// import App from './package/onlyoffice.vue'
|
|
12
|
+
// createApp(App).mount('#app')
|
|
9
13
|
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
createApp(App).mount('#app')
|
|
14
|
+
import onlyoffice from "./package/onlyoffice.vue";
|
|
15
|
+
export { onlyoffice };
|
|
14
16
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import onlyoffice from "./onlyoffice.vue"; // 引入封装好的组件
|
|
2
|
+
const coms = [onlyoffice]; // 将来如果有其它组件,都可以写到这个数组里
|
|
3
|
+
|
|
4
|
+
// 批量组件注册
|
|
5
|
+
const install = function (Vue) {
|
|
6
|
+
coms.forEach((com) => {
|
|
7
|
+
Vue.component(com.name, com);
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default install; // 这个方法以后再使用的时候可以被use调用
|