Installation
The @mr-components package can be installed by running:
npm install --save-dev @carlosdevpereira/mr-components
How to use
To start using the components, you can either:
main.js
file:
Register the components globally in your import App from './App.vue'
import { createApp } from 'vue'
import '@carlosdevpereira/mr-components/dist/style.css'
import UseMrComponents from '@carlosdevpereira/mr-components'
// other imports
let app = createApp(App)
UseMrComponents(app)
Register only the components you need:
import App from './App.vue'
import { createApp } from 'vue'
import '@carlosdevpereira/mr-components/dist/style.css'
import { Button, Checkbox } from '@carlosdevpereira/mr-components'
// other imports
let app = createApp(App)
app.component('Button', Button)
app.component('Checkbox', Checkbox)
Import the components directly in your Single File Components:
<template>
<div>
<button>Click me</button>
</div>
</template>
<script>
import '@carlosdevpereira/mr-components/dist/style.css'
import { Button } from '@carlosdevpereira/mr-components'
export default {
components: {
Button,
},
// ...
}
</script>