Guides

Vue.js

importOK is a reusable custom web component that embeds an import wizard into your app. You can follow this installation guide to use it as a Vue.js component.

Installation

The tester version of the importOK JavaScript and React components are available on NPM, while the full (paid) versions are hosted in a private repository. Both versions are fully compatible and no code changes are required when upgrading to the full (paid) versions.

1npm install @importok/vue

Usage

To embed the importOK wizard in your Vue.js project, simply add the following snippet to your component or page. This will render the interactive import wizard, allowing users to import data seamlessly. For a complete list of configuration options, including available props and event handlers, refer to the Props & Events section of the documentation.

To help you get started, we’ve also prepared a live StackBlitz example you can use as a reference for setting up your configuration.

1<script>
2import ImportokWizard from "@importok/vue";
3 
4export default {
5 components: {
6 ImportokWizard
7 },
8 
9 methods: {
10 /**
11 * Push the provided record to the API
12 * Check https://importok.io/docs/webhooks for more details
13 */
14 async saveRecord(record, meta) {}
15 },
16 
17 data() {
18 return {
19 /**
20 * Import fields to be mapped
21 * Check https://importok.io/docs/fields for more details
22 */
23 fields: {}
24 };
25 }
26};
27</script>
28<template>
29 <ImportokWizard
30 title="ImportOK Example for Vue"
31 :fields="fields"
32 sample-file="/sample.csv"
33 @record-ready="saveRecord"
34 />
35</template>

Note: There is a limit of 20 records for each import with the trial version. Additionally, access to custom validators, transformers, and data providers is restricted. Once you upgrade to a paid plan, you’ll gain access to the private packages and unlock full functionality with no limitations.