Skip to content

Instantly share code, notes, and snippets.

Avatar
🖖
I want it so i get it

Chinonso Chukwuogor nonsocode

🖖
I want it so i get it
View GitHub Profile
@nonsocode
nonsocode / n-errorbag.js
Created Aug 9, 2018
A simple Frontend Validation Error bag meant to work with Laravel validation
View n-errorbag.js
class ErrorBag {
constructor(errors = {}) {
this.setErrors(errors);
}
hasErrors() {
return !!this.keys.length;
}
get keys() {
@nonsocode
nonsocode / n-select.vue
Last active Aug 2, 2018
A simple multi select Component for Vuejs
View n-select.vue
<template>
<div class="n-select" :class="{'is-small' : small, opened: list}" ref="nSelect">
<div class="over-con">
<div class="search-container" ref="searchContainer" @click.stop="openAndSearch">
<template v-if="multiple">
<div class="selected-item" v-for="val in selected" :key="trackBy ? val[trackBy] : val" >
<span class="text">{{label ? val[label] : val}}</span>
<button class="close" @click="removeItem(val)">&times;</button>
</div>
</template>