@astrojs/vue
Advanced tools
Comparing version 0.1.4 to 0.1.5
# @astrojs/vue | ||
## 0.1.5 | ||
### Patch Changes | ||
- [#3455](https://github.com/withastro/astro/pull/3455) [`e9a77d86`](https://github.com/withastro/astro/commit/e9a77d861907adccfa75811f9aaa555f186d78f8) Thanks [@natemoo-re](https://github.com/natemoo-re)! - Update client hydration to check for `ssr` attribute. Requires `astro@^1.0.0-beta.36`. | ||
## 0.1.4 | ||
@@ -4,0 +10,0 @@ |
@@ -1,14 +0,22 @@ | ||
import { h, createSSRApp } from 'vue'; | ||
import { h, createSSRApp, createApp } from 'vue'; | ||
import StaticHtml from './static-html.js'; | ||
export default (element) => (Component, props, children) => { | ||
delete props['class']; | ||
// Expose name on host component for Vue devtools | ||
const name = Component.name ? `${Component.name} Host` : undefined; | ||
const slots = {}; | ||
if (children != null) { | ||
slots.default = () => h(StaticHtml, { value: children }); | ||
} | ||
const app = createSSRApp({ name, render: () => h(Component, props, slots) }); | ||
app.mount(element, true); | ||
}; | ||
export default (element) => | ||
(Component, props, children, { client }) => { | ||
delete props['class']; | ||
if (!element.hasAttribute('ssr')) return; | ||
// Expose name on host component for Vue devtools | ||
const name = Component.name ? `${Component.name} Host` : undefined; | ||
const slots = {}; | ||
if (children != null) { | ||
slots.default = () => h(StaticHtml, { value: children }); | ||
} | ||
if (client === 'only') { | ||
const app = createApp({ name, render: () => h(Component, props, slots) }); | ||
app.mount(element, false); | ||
} else { | ||
const app = createSSRApp({ name, render: () => h(Component, props, slots) }); | ||
app.mount(element, true); | ||
} | ||
}; |
{ | ||
"name": "@astrojs/vue", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Use Vue components within Astro", | ||
@@ -33,5 +33,5 @@ "type": "module", | ||
"devDependencies": { | ||
"astro": "1.0.0-beta.28", | ||
"astro-scripts": "0.0.3", | ||
"vue": "^3.2.33" | ||
"astro": "1.0.0-beta.38", | ||
"astro-scripts": "0.0.4", | ||
"vue": "^3.2.36" | ||
}, | ||
@@ -38,0 +38,0 @@ "peerDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14057
143