@aerogel/core 0.1.0-next.c4b24f52d8b652bd5c14c2d12e1b38b779ab7682 → 0.1.0-next.f99d02aba04109e68987d90489974bfa0bb54a41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aerogel-core.d.ts +11 -11
- package/dist/aerogel-core.js +735 -731
- package/dist/aerogel-core.js.map +1 -1
- package/package.json +1 -1
- package/src/directives/index.ts +3 -1
- package/src/directives/safe-html.ts +10 -0
package/package.json
CHANGED
package/src/directives/index.ts
CHANGED
|
@@ -3,9 +3,11 @@ import type { Directive } from 'vue';
|
|
|
3
3
|
import { definePlugin } from '@aerogel/core/plugins';
|
|
4
4
|
|
|
5
5
|
import measure from './measure';
|
|
6
|
+
import safeHtml from './safe-html';
|
|
6
7
|
|
|
7
8
|
const builtInDirectives: Record<string, Directive> = {
|
|
8
|
-
measure: measure,
|
|
9
|
+
'measure': measure,
|
|
10
|
+
'safe-html': safeHtml,
|
|
9
11
|
};
|
|
10
12
|
|
|
11
13
|
export * from './measure';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { safeHtml } from '@aerogel/core/utils';
|
|
2
|
+
import { defineDirective } from '@aerogel/core/utils/vue';
|
|
3
|
+
|
|
4
|
+
export type SafeHTMLDirectiveValue = string;
|
|
5
|
+
|
|
6
|
+
export default defineDirective<SafeHTMLDirectiveValue>({
|
|
7
|
+
mounted(element: HTMLElement, { value }) {
|
|
8
|
+
element.innerHTML = safeHtml(value);
|
|
9
|
+
},
|
|
10
|
+
});
|