Most of the time is all you will need.
If you followed the integration guide, components will be globally registered with the vk
prefix, eg. vk-button
, and we recommend to follow that convention even when registering them manually. That way they will not conflict with other components or native elements plus will become easily recognizable.
<vk-button props>...</vk-button>
Extending a component sometimes is easy and possible with the inbuilt Vue extend
component option. But when the requirements are so different from the component spec, it may make more sense to start the component over. If you find your self in that position here are few things that you should know.
vue-data-merge
util in your functional components, almost always.Vuikit separates the components logic from the rendering by keeping an independent collection of UI Elements for each component which unique purpose is to render a layout. Think of these as UI elements with API (props) that you can rely on to build your components. Those are prefixed with element
and registered globally as well, eg. vk-element-icon
.
Lets say you are looking for a way to use your very own icon library. Instead of wrapping or altering the vk-icon
component, a better way would be to create your custom my-icon
component which would render the final icon with vk-element-icon
.
Note Avoid relying on globally registered components and always import them. In this case the elements are also available in the Vuikit exports, eg. import { ElementIcon } from 'vuikit'
.