Using Emmet Tab completion in Sublime React

Install Sublime React plugin Copy this to key binding config { “keys”: [“tab”], “command”: “expand_abbreviation_by_tab”, // put comma-separated syntax selectors for which // you want to expandEmmet abbreviations into “operand” key // instead of SCOPE_SELECTOR. // Examples: source.js, text.html – source “context”: [ { “operand”: “, text.html”, “operator”: “equal”, “match_all”: true, “key”: “selector” }, // […]

import/use axios or any other libraries in Vue components

I used to do this in main.js: import axios from ‘axios’ window.axios = axios and use window.axios in components. This forum reply suggested a much better solution: // main.js import Vue from ‘vue’; import axios from ‘axios’; Vue.prototype.$http = axios; // or $axios or whatever you want // component.js // … methods: { getItems […]

Laravel deployment on shared hosting – .htaccess rewrite rule

One problem I just ran into when I tried to deploy a Laravel app to my shared hosting service Siteground. I copied my repo to a subdomain folder and ran the usual php and composer commands to set everything up. But I had to use the url to actually access the app’s public folder. […]

v-bind image src to dynamic image links

Because v-bind:src or simply :src is not recognized by webpack thus the images are not loaded and compiled to dist. One way to solve the problem is by using the require.context provided by webpack. getUrl (id) { var images = require.context(‘../assets/images/photos/’, false, /\.jpg$/) var imgArray = this.carouselImages if (id === 1) { return images(‘./’ + […]

Day 10 of Vue.js

How is v-model implemented <input type=”text” v-model=”coupon”> <hr> <input type=”text” :value=”coupon” @input=”updateCoupon($”> new Vue({ el: ‘#root’, data: { coupon: ‘coupon is here’ }, methods: { updateCoupon(input) { = input; } } }); The two input do the same trick. ##Custom Input Component something new in vue 2.2 quoted from crouchingHamster on Laracast: Using :value=”code” […]