npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-2-custom-input-component

v1.0.3

Published

Custom input component for Vue 2.x

Downloads

8

Readme

Custom Input Component for VueJS 2.*

Creating input field isn't same anymore. :D

Features

  • Support v-model
  • Generate radio and checkbox from array

Requirement

  • Vue 2.*

Available Input Components

  • Radio (VueRadio and VueRadioBlock)
  • Checkbox (VueCheckbox and VueCheckboxBlock)

Components

Non-Block Components

Radio and Checkbox

| Parameter | Usage | | ------------ | ------------ | |id|The "id" attribute for input element and label element.| |values|The value of the radio or checkbox element.| |nameGroup|The "name" attribute for grouping the element.| |label|The value for the label element.| |modelValue|It is used to mimic the v-model behaviour for checkbox element and fix the reactivity for radiobox. Filled with the name of the v-model.|

Block Components

Radio Block and Checkbox Block

| Parameter | Usage | | ------------ | ------------ | |blockTitle|Title of the block.| |radioData / checkboxData|radio or checkbox data|

How To Use

Installing the module

$ npm i vue-2-custom-input-component --save

Usage

Importing the components
import {VueRadio,VueRadioBlock,VueCheckbox,VueCheckboxBlock} from 'vue-2-custom-input-component'
Register the components
  • Global
Vue.component("vue-radio", VueRadio)
Vue.component("vue-radio-block", VueRadioBlock)
Vue.component("vue-checkbox", VueCheckboxBlock)
Vue.component("vue-checkbox-block", VueCheckboxBlock)
  • Local
export default {
	components: {
		 VueRadio,
		 VueRadioBlock,
		 VueCheckbox,
		 VueCheckboxBlock
	},
	data(){
		return {

		}
	}
}

Sample

  • VueRadio VueRadio Sample
// component.vue
<template
	<div>
		<vue-radio
			v-for="(item, index) in radioGender.data"
			:id="radioGender.name+index"
			:key="index"
			:nameGroup="radioGender.name"
			:values="item.value"
			:label="item.label"
			:modelValue="form.gender"
			v-model="form.gender"></vue-radio>

			<div>
			<p>Selected : {{form.gender}}</p>
			</div>
	</div>
</template>
<script>
export default{
	data(){
		return {
			form:{
				gender : ""
			},
			radioGender : {
				name : 'gender',
				titile : 'Gender',
				data: [
					{value:"M", label: "Male"},
					{value:"F", label: "Female"}
				]
			}
		}
	}
}
</script>
  • VueCheckbox VueCheckbox Sample
// component.vue
<template
	<div>
		<vue-checkbox
			v-for="(item, index) in checkboxHobby.data"
			:id="checkboxHobby.name+index"
			:key="index"
			:nameGroup="checkboxHobby.name"
			:values="item.value"
			:label="item.label"
			:modelValue = "form.hobby"
			v-model="form.hobby"></vue-checkbox>

			<div>
			<p>Selected : {{form.hobby}}</p>
			</div>
	</div>
</template>
<script>
export default{
	data(){
		return {
			form:{
				hobby : ""
			},
			checkboxHobby : {
				name : 'hobby',
				titile : 'Hobby',
				data: [
					{value:"soccer", label: "Soccer"},
					{value:"watching_anime", label: "Watching Anime"},
					{value:"playing_with_cat", label: "Playing with Cat"},
					{value:"read_history_books", label: "Read History Books"},
				]
			}
		}
	}
}
</script>

Repository

https://github.com/OnielN14/custom-input-component-vuejs2

Author

  • Daniyal Ahmad Rizaldhi (Github: onieln14)

Credits

Thanks to humanity. Love You Everyone!!! Because You All Are Great!!!