diff --git a/package.json b/package.json index acd4516..9cad53c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bd/core", - "version": "1.9.0", + "version": "1.9.1", "type": "module", "description": "百搭UI组件库的核心", "main": "dist/index.js", diff --git a/src/html.js b/src/html.js index 1a90758..474b47a 100644 --- a/src/html.js +++ b/src/html.js @@ -714,14 +714,19 @@ export function render(value, container, options = {}) { return part } -export const html = (strings, ...values) => { +export function html(strings, ...values) { return { __dom_type__: HTML_RESULT, strings, values } } -export const svg = (strings, ...values) => { +export function raw(str) { + let strings = [str] + strings.raw = strings + return html(strings) +} +export function svg(strings, ...values) { return { __dom_type__: SVG_RESULT, strings, diff --git a/src/index.js b/src/index.js index 028e655..5512a71 100644 --- a/src/index.js +++ b/src/index.js @@ -15,11 +15,11 @@ import { __children__ } from './constants.js' import { css, adoptStyles } from './css.js' -import { render, html, svg } from './html.js' +import { render, html, svg, raw } from './html.js' import { animate, MODES } from './anim.js' import { nextTick, fire, bind, unbind, hyphen } from './utils.js' export { $, $$, offset, outsideClick, clearOutsideClick } from './utils.js' -export { html, css, svg, bind, unbind, nextTick, fire } +export { html, raw, css, svg, bind, unbind, nextTick, fire } // 简单的类名解析 export function classMap(data = {}) {