
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@jagaad/vue-hubspot-form
Advanced tools
A Vue wrapper for HubSpot Forms
npm install @jagaad/vue-hubspot-form
<script setup>
import HubspotForm from '@jagaad/vue-hubspot-form';
</script>
<template>
<HubspotForm
@ready="onReady"
:options="options"
:fallback="fallback"
:error="error"
></HubspotForm>
</template>
<script setup>
import { useHubspotForm } from '@jagaad/vue-hubspot-form';
const { difRef, isLoading, isError } = useHubspotForm(options, onReady)
</script>
<template>
<div v-if="!(isLoading || isError)" ref="divRef">
<component v-if="isLoading" :is="fallback" />
<component v-if="isError" :is="error" />
</template>
All examples make use partially of code blocks defined below
<template>
<HubspotForm
@ready="onReady"
:options="options"
:fallback="fallback"
:error="error"
/>
</template>
<template>
<HubspotForm
:onReady="onReady"
:options="options"
:fallback="fallback"
:error="error"
/>
</template>
import { CreateOptions } from '@jagaad/vue-hubspot-form';
// these values are fake, add your own
const options: CreateOptions = {
// ...
// Read the official docs for more info
cssRequired: `.hubspot-link__container { display: none }`,
// ...
};
import { Payload } from '@jagaad/vue-hubspot-form';
function onReady({ iframeDocument: doc }: Payload) {
const element = doc.createElement('style');
const styles = `.hubspot-link__container { display: none }`;
element.appendChild(doc.createTextNode(styles));
doc.head.appendChild(element);
}
import jss, { Rule } from 'jss';
jss.use({
// this will make JSS to use selectors as names
onCreateRule(name, _decl, options) {
options.selector = name;
return null as unknown as Rule;
},
});
const styleSheet = jss.createStyleSheet({
'.hubspot-link__container': {
display: 'none',
},
});
const options = {
// ...
cssRequired: styleSheet.toString(),
};
Options:
import { CreateOptions } from '@jagaad/vue-hubspot-form';
// these values are fake, add your own
const options: CreateOptions = {
region: 'eu1',
portalId: '83991272',
formId: '25f1e214-1236-45c3-810m-d8dk31736c72',
// ...
};
On Ready callback:
import { Payload } from '@jagaad/vue-hubspot-form';
const onReady = (payload: Payload) => console.log(payload);
Fallback Components:
import { defineComponent } from 'vue';
// Loading Component
const fallback = defineComponent({
/* ... */
});
// Error Component
const error = defineComponent({
/* ... */
});
git clone git@github.com:jagaad/vue-hubspot-form.git
cd vue-hubspot-form
npm install
.env
file to .env.local
.env.local
to your HubSpot valuesnpm run dev
This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 <script setup>
SFCs, check out the script setup docs to learn more.
.vue
Imports in TSSince TypeScript cannot handle type information for .vue
imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in .vue
imports (for example to get props validation when using manual h(...)
calls), you can enable Volar's .vue
type support plugin by running Volar: Switch TS Plugin on/off
from VSCode command palette.
FAQs
A Vue wrapper for HubSpot Forms
The npm package @jagaad/vue-hubspot-form receives a total of 197 weekly downloads. As such, @jagaad/vue-hubspot-form popularity was classified as not popular.
We found that @jagaad/vue-hubspot-form demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.