create vue 2 component library

Customizable Vuejs Tree Viewer. Even when using Vue CLI to create a component library, you still need to manually edit the package.json file to configure and generate the NPM package. Note that Vue Demi also includes standard APIs that are already present in Vue, such as ref, onMounted, and onUnmounted, among others. First, install the latest Vue CLI 4 on your local development system for working with Vue. Lets thus create a basic store structure to store how many times our DummyButton component has been click. The first thing were going to do is to import Vuex and create a Vuex instance. I removed /dist from .gitignore file and commit all changes to Github. Youll also need to add vue and @vue/composition-api as your librarys peer dependencies to specify the version it should support. Then we register our Vuex module and call it dummylib (we could have call it as we wanted). Now that we had our store lets make sure it can be used. In the Project tool window, select the parent folder for the new component, and then choose Vue Component from the list. To do so. $ mkdir vue3-component-library $ cd vue3-component-library $ npm init -y $ git init $ touch .gitignore $ echo 'node_modules' >> .gitignore Download Vue project by following the below command. . Details. vue create vue-component-library After the project is created, and dependencies downloaded, you should see this in your terminal: Successfully created project vue-component-library. Lets make a new file lib-setup.js in src. As an introduction to the world of Vue plugins, we're going to write a plugin that writes to the console every time a component is mounted to the DOM. Popup JS provides an easy way to integrate Paystack into our website and start receiving payments: The scriptLoaded state helps us to know if the Paystack Popup JS script has been added, and the loadScript method loads the Paystack Popup JS script and adds it to our documents head. The payWithPaystack method is used to initialize a transaction with the Paystack Popup JS when called: The render function helps us create our component without a