Vue component library for Vue 2.
Webpack build is based on the wonderful project https://github.com/vitogit/vue-chessboard , however simplified and actualized to Webpack 5. Style is incorporated in the js
module, rather than having to import a separate css
file.
https://github.com/matthewmaribojoc/learn-vue-tab
yarn add @publishvue/vuecomps
Import in Nuxt.js page
<script>
import { Labeled } from "@publishvue/vuecomps"
export default {
components: {
Labeled
}
}
<script>
Then use in the template
<template>
<div class="cont">
<Labeled label="Demo Label">
Normal
</Labeled>
vs.
<Labeled label="Demo Label" rev="true">
Reversed
</Labeled>
</div>
</template>
<style>
.cont {
display: flex;
align-items: center;
}
</style>
Labeled content. Label can be either on left or right side.
String
, required. Label to be displayed.
Boolean
, optional, defaults tofalse
. By default the label is rendered on the left side. Ifrev
istrue
then the label will be rendered on the right side.
Persistent checkbox.
String
, required. Local storage unique ID, to be used to store checkbox state.
Boolean
, optional, defaults tofalse
. Default value to use when there is not a yet a stored value in local storage,false
for unchecked andtrue
for checked.
Event content
id
Local storage unique ID.
value
Value of the persistent checkbox, false
for unchecked, true
for checked.
Assuming the ref
of the component is myperscheck
console.log(this.$refs.myperscheck.value)
Not possible. If you want a component tied to your data, then use a conventional checkbox.
Persistent text input.
String
, required. Local storage unique ID, to be used to store checkbox state.
String
, optional, defaults to empty string. Default value to use when there is not a yet a stored value in local storage.
Event content
id
Local storage unique ID.
value
Value of the persistent text input.
Assuming the ref
of the component is myperstext
console.log(this.$refs.myperstext.value)
Not possible. If you want a component tied to your data, then use a conventional text input.
Persistent combo box.
String
, required. Local storage unique ID, to be used to store checkbox state.
Array
, required. Each element of the array is an object that has adisplay
and avalue
field. The former will be shown to the user, that latter will be returned as selected value.
[
{
display: "Display1",
value: "value1",
},
{
display: "Display2",
value: "value2",
},
...
}
Event content
id
Local storage unique ID.
value
Selected value of the persistent combo.
Tabpane. To be used with the Tab component.
Number
, required. Width of tabs in px.
Number
, required. Height of tabs in px.
String
, optional, defaults tolight
. Mode of the Tabpnae, possible values:light
,dark
.
None.
Tab. To be used with the Tabpane component.
String
, optional, defaults toTab
. Title of the tab.
None.
<Tabpane>
<Tab title="Labeled">
<Labeled label="My Label">
My Content
</Labeled>
</Tab>
<Tab title="Perscheck">
<Perscheck id="myperscheck" />
</Tab>
<Tab title="Perstext">
<Perstext id="myperstext" />
</Tab>
</Tabpane>