This commit is contained in:
xyf-mac 2021-11-13 11:51:48 +08:00
parent d7ae6c4f45
commit b0bd8673ba
2 changed files with 3 additions and 2 deletions

View File

@ -18,8 +18,9 @@ class PortMan {
}
private onPortConnect(port: chrome.runtime.Port, onMsg: Function, onDisconnect: Function) {
console.log(`%c[Connect] ${port.name}`, "color:green");
port.onMessage.addListener((data: any, sender: any) => {
console.log(`%c[Connect-Message] ${sender.name}\n${JSON.stringify(data)}`, "color:green;")
console.log(`%c[Connect-Message] ${sender.name}\n${JSON.stringify(data)}`, "color:blue;")
// 如果多个页面都监听 onMessage 事件,对于某一次事件只有第一次调用 sendResponse() 能成功发出回应,所有其他回应将被忽略。
// sender.postMessage(data);
onMsg && onMsg(data);

View File

@ -486,7 +486,7 @@ export default class UiProp extends Vue {
.normal-data {
.value {
min-width: 100px;
min-width: 50px;
}
.key {