import{ax as i,z as a,A as l,b5 as t}from"./chunks/framework.V2ssSR2R.js";const d=JSON.parse('{"title":"工具函数","description":"","frontmatter":{},"headers":[],"relativePath":"runtime-api/core/utils.md","filePath":"runtime-api/core/utils.md"}'),n={name:"runtime-api/core/utils.md"};function e(h,s,p,r,k,o){return l(),a("div",null,[...s[0]||(s[0]=[t(`

工具函数

@tmagic/core 导出的工具函数。

style2Obj

typescript
import { style2Obj } from '@tmagic/core';

const styleObj = style2Obj('width: 100px; height: 200px;');
console.log(styleObj); // { width: '100px', height: '200px' }

fillBackgroundImage

typescript
import { fillBackgroundImage } from '@tmagic/core';

const bg = fillBackgroundImage('https://example.com/image.png');
console.log(bg); // 'url(https://example.com/image.png)'

getTransform

transformStyle

typescript
import { transformStyle } from '@tmagic/core';

const style = transformStyle({ width: 100, height: 200 }, 'browser');
console.log(style); // { width: '1rem', height: '2rem' }

常量

COMMON_EVENT_PREFIX

COMMON_METHOD_PREFIX

typescript
import { COMMON_EVENT_PREFIX, COMMON_METHOD_PREFIX } from '@tmagic/core';

const eventKey = \`\${COMMON_EVENT_PREFIX}click\`;
const methodKey = \`\${COMMON_METHOD_PREFIX}show\`;
`,19)])])}const c=i(n,[["render",e]]);export{d as __pageData,c as default};