mirror of
https://github.com/motajs/template.git
synced 2026-11-08 02:54:30 +08:00
fix: TextContent 的 loc 允许动态传入
This commit is contained in:
1 parent
e69dc0af06
commit
f5f8322985
1 file changed
+4
-5
@@ -161,14 +161,13 @@ export const TextContent = defineComponent<
|
||||
|
||||
const updateLoc = () => {
|
||||
const height = getHeight();
|
||||
if (props.autoHeight) {
|
||||
const [x = 0, y = 0, width = props.width, , ax = 0, ay = 0] =
|
||||
loc.value;
|
||||
loc.value = [x, y, width, height, ax, ay];
|
||||
}
|
||||
const [x = 0, y = 0, , h = 0, ax = 0, ay = 0] = props.loc ?? loc.value;
|
||||
loc.value = [x, y, props.width, props.autoHeight ? height : h, ax, ay];
|
||||
emit('updateHeight', height);
|
||||
};
|
||||
|
||||
watch(() => props.loc, updateLoc);
|
||||
|
||||
expose<TextContentExpose>({ retype, showAll, getHeight });
|
||||
|
||||
const spriteElement = shallowRef<CustomRenderItem>();
|
||||
|
||||
Reference in new issue
Block a user