import{ax as i,z as a,A as t,b2 as l}from"./chunks/framework.DkLJC2NO.js";const g=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(p,s,h,r,k,o){return t(),a("div",null,[...s[0]||(s[0]=[l(`

工具函数

@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{g as __pageData,c as default};