Skip to content

Instantly share code, notes, and snippets.

Avatar

Richard Delorier RDelorier

View GitHub Profile
@RDelorier
RDelorier / chosen_select.js
Created Nov 18, 2015
Notify Vue when chosen select updates
View chosen_select.js
"use strict";
import Vue from 'vue';
Vue.directive('chosen', {
bind(){
var event = document.createEvent('HTMLEvents');
event.initEvent('change', true, true);
$(this.el).chosen({
@RDelorier
RDelorier / example.html
Last active Jan 27, 2017
Vue js filter to use with select options
View example.html
//js
users = [
{ name:'foo', id:1 },
{ name:'bar', id:2 },
{ name:'baz', id:3 }
];
//html
<select
v-model="user.id"
View states_hash.json
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",