diff options
author | 2021-03-16 12:37:45 -0600 | |
---|---|---|
committer | 2021-03-16 12:37:45 -0600 | |
commit | 8c45c4a8567e31a10ae954fa11a0f3f1f94fd89c (patch) | |
tree | e526f67e93ed5a7fcf9237c2d30ec536a4a96d7b /src/frontend/render/vue.ts | |
parent | 1f5c7c791fe3595f4c775192ffc6b6a15efb71a1 (diff) | |
download | astro-8c45c4a8567e31a10ae954fa11a0f3f1f94fd89c.tar.gz astro-8c45c4a8567e31a10ae954fa11a0f3f1f94fd89c.tar.zst astro-8c45c4a8567e31a10ae954fa11a0f3f1f94fd89c.zip |
Annoying Lint PR™ (#3)
* Add Prettier + ESLint
* Format files
Diffstat (limited to 'src/frontend/render/vue.ts')
-rw-r--r-- | src/frontend/render/vue.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/frontend/render/vue.ts b/src/frontend/render/vue.ts index f83c1665a..6b89aa11e 100644 --- a/src/frontend/render/vue.ts +++ b/src/frontend/render/vue.ts @@ -7,11 +7,11 @@ export function __vue_static(VueComponent: Component) { return async (attrs: Record<string, any>, ...children: any): Promise<string> => { const app = createSSRApp({ components: { - VueComponent + VueComponent, }, render() { return createElement(VueComponent as any, attrs); - } + }, }); const html = await renderToString(app); @@ -23,7 +23,7 @@ export function __vue_static(VueComponent: Component) { export function __vue_dynamic(VueComponent: Component, importUrl: string, vueUrl: string) { const placeholderId = `placeholder_${String(Math.random())}`; return (attrs: Record<string, string>, ...children: any) => { - return `<div id="${placeholderId}"></div><script type="module"> + return `<div id="${placeholderId}"></div><script type="module"> import Component from '${importUrl}'; import {createApp, h as createElement} from '${vueUrl}'; @@ -36,4 +36,4 @@ export function __vue_dynamic(VueComponent: Component, importUrl: string, vueUrl createApp(App).mount(document.getElementById('${placeholderId}')); </script>`; }; -}
\ No newline at end of file +} |