style: pin & table
This commit is contained in:
parent
63c320f669
commit
bd2e7ac5a5
|
|
@ -51,7 +51,7 @@ customElement("md-pin", { x: 0, y: 0 }, (props, { element }) => {
|
|||
if (!targetImage || !pinContainer) return;
|
||||
|
||||
const imgRect = targetImage.getBoundingClientRect();
|
||||
const containerRect = pinContainer.getBoundingClientRect();
|
||||
const containerRect = pinContainer.parentElement.getBoundingClientRect();
|
||||
|
||||
// 计算图片左上角相对于容器原始位置的偏移
|
||||
const offsetX = imgRect.left - containerRect.left;
|
||||
|
|
@ -103,10 +103,10 @@ customElement("md-pin", { x: 0, y: 0 }, (props, { element }) => {
|
|||
});
|
||||
|
||||
return (
|
||||
<span
|
||||
<div
|
||||
ref={pinContainer}
|
||||
class="md-pin-container"
|
||||
style={{ display: 'inline-block', transform: transformStyle(), 'transform-origin': 'top left' }}
|
||||
style={{ transform: transformStyle(), 'transform-origin': 'top left' }}
|
||||
>
|
||||
<Show when={visible() && targetImage}>
|
||||
<span
|
||||
|
|
@ -128,6 +128,6 @@ customElement("md-pin", { x: 0, y: 0 }, (props, { element }) => {
|
|||
{toastMessage()}
|
||||
</div>
|
||||
</Show>
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ customElement('md-table', { roll: false, remix: false }, (props, { element }) =>
|
|||
<Show when={props.roll}>
|
||||
<button
|
||||
onClick={handleRoll}
|
||||
class="text-gray-500 hover:text-gray-700 flex-shrink-0"
|
||||
class="text-gray-500 hover:text-gray-700 flex-shrink-0 cursor-pointer"
|
||||
title="随机切换"
|
||||
>
|
||||
🎲
|
||||
|
|
@ -197,7 +197,7 @@ customElement('md-table', { roll: false, remix: false }, (props, { element }) =>
|
|||
{(row, index) => (
|
||||
<button
|
||||
onClick={() => setActiveTab(index())}
|
||||
class={`font-medium transition-colors flex-shrink-0 min-w-[1.6em] ${
|
||||
class={`font-medium transition-colors flex-shrink-0 min-w-[1.6em] cursor-pointer ${
|
||||
activeTab() === index()
|
||||
? 'text-blue-600 border-b-2 border-blue-600'
|
||||
: 'text-gray-500 hover:text-gray-700'
|
||||
|
|
|
|||
Loading…
Reference in New Issue