更新Invoker,移除tsx
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
defineComponent,
|
defineComponent,
|
||||||
|
h,
|
||||||
|
isVue2,
|
||||||
onMounted,
|
onMounted,
|
||||||
onUnmounted,
|
onUnmounted,
|
||||||
ref,
|
ref,
|
||||||
@@ -9,6 +11,7 @@ import {
|
|||||||
import { ModContext } from "../types/ModContext";
|
import { ModContext } from "../types/ModContext";
|
||||||
import { InvokerItem } from "./InvokerItem";
|
import { InvokerItem } from "./InvokerItem";
|
||||||
import { modPageConfig } from "../modPageConfig";
|
import { modPageConfig } from "../modPageConfig";
|
||||||
|
import { hh } from "./DemiHelper";
|
||||||
|
|
||||||
let idCount = 0;
|
let idCount = 0;
|
||||||
export type InvokerModName = string;
|
export type InvokerModName = string;
|
||||||
@@ -108,18 +111,17 @@ export default defineComponent({
|
|||||||
emit('destroyed');
|
emit('destroyed');
|
||||||
});
|
});
|
||||||
|
|
||||||
return (h) => {
|
return (createElem) => {
|
||||||
|
const render = isVue2 ? createElem : h;
|
||||||
if (slots.default) {
|
if (slots.default) {
|
||||||
return <div>{slots.default()}</div>;
|
return render('div', {}, slots.default());
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return hh('iframe', {
|
||||||
<iframe
|
src: url.value,
|
||||||
src={url.value}
|
scrolling: props.scroll ? "yes" : "no",
|
||||||
scrolling={props.scroll ? "yes" : "no"}
|
style: `border: none; width: 100%; height: ${props.height}; `
|
||||||
style={`border: none; width: 100%; height: ${props.height}; `}
|
});
|
||||||
></iframe>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
Reference in New Issue
Block a user