Skip to content

Instantly share code, notes, and snippets.

View Paretkf's full-sized avatar
🏠
Working from home

Rachata Paretkf

🏠
Working from home
View GitHub Profile
@Paretkf
Paretkf / GitCommitEmoji.md
Created October 10, 2021 17:09 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
module.exports = {
root: true,
env: {
es6: true,
node: true
},
extends: [
'plugin:vue/recommended',
'@vue/standard',
'airbnb-base'
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/*": ["./*"],
"@/*": ["./*"],
"~~/*": ["./*"],
"@@/*": ["./*"]
}
},
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/rachata/.oh-my-zsh"
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="cobalt2"
<template>
<div id="app">
<img src="./assets/logo.png"> <br>
<button @click="getUser()">get User from API</button> <br>
{{user}}
</div>
</template>
<script>
import HelloWorld from './components/HelloWorld'
import Vue from 'vue'
import Vuex from 'vuex'
import UserProvider from '@/resources/user_provider'
const userService = new UserProvider()
Vue.use(Vuex)
const modules = {
}
import HttpRequest from './http_request'
class UserProvider extends HttpRequest {
constructor () {
// api api
super('https://api.myjson.com/bins/17k39m')
}
async getUser () {
// example path https://api.myjson.com/bins/17k39m/
import axios from 'axios'
class HttpRequest {
constructor (url = 'https://api.myjson.com/bins/17k39m') {
// this.axios = axios
this.axiosInstance = axios.create({
baseURL: url,
timeout: 120000
})
@Paretkf
Paretkf / App.vue
Created November 5, 2018 04:09
example for vue-highlight-text.
<template>
<div id="app">
<h1>Example Highlight</h1>
<h2>input</h2>
<div>
<b>overWriteStyle</b> {{overWriteStyle}}
</div>
<div>
<input type="text" v-model="newKeyword">
<button @click="addKeyword(newKeyword)">Add Keyword</button>
<template>
<div class="hello">
<h1>{{ $t("message.hello") }}</h1> <br>
<button @click="switchLocale()">{{ displayLocale }}</button>
</div>
</template>
<script>
export default {
name: 'HelloWorld',