Skip to content

Instantly share code, notes, and snippets.

View handrihmw's full-sized avatar
🪁

Handri Hermawan handrihmw

🪁
View GitHub Profile
@handrihmw
handrihmw / echarts
Created December 6, 2023 09:03
echarts
// chart.client.ts
import ECharts from 'vue-echarts'
import { use } from 'echarts/core'
// import 'echarts' // all library
// import 'echarts/lib/chart/bar'
// import 'echarts/lib/chart/line'
// import 'echarts/lib/chart/pie'
@handrihmw
handrihmw / pinia-vue.js
Created August 10, 2023 03:02
Pinia Vue Example
import { defineStore } from 'pinia'
export const useProductStore = defineStore('product', {
state: () => ({
products: [],
isFetchingProducts: false
}),
getters: {
categories () {
const categoryList = this.products
@handrihmw
handrihmw / get-api-vue.js
Last active August 10, 2023 02:58
Get API with Vue JS
// Optional API
<script>
export default {
data() {
return {
listItems: []
}
},
methods: {
async getData() {
@handrihmw
handrihmw / webpack.config.js
Created November 16, 2022 04:01
Webpack Multi
const path = require("path");
const Dotenv = require("dotenv-webpack");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
let appConf = (env) => {
return {
mode: env.NODE_ENV,
devtool: "nosources-source-map",
// Button Variants
$buttonType: (
(primary $as-orange-100 $as-orange-200 $as-orange-300 $as-shadow-orange-100),
(secondary $as-blue-100 $as-blue-200 $as-blue-300 $as-shadow-blue-100),
(danger $as-red-100 $as-red-200 $as-red-300 $as-shadow-red-100)
);
.as-btn {
@extend %btn-helper !optional;
}
$as-white: #ffffff;
// Primary
$as-orange-100: #ffe082;
$as-orange-200: #ff9800;
$as-orange-300: #ed8e01;
// Secondary
$as-blue-100: #e0efff;
$as-blue-200: #94ccf7;
%btn-helper {
-webkit-box-align: baseline;
align-items: baseline;
border: none;
border-radius: 2rem;
box-sizing: border-box;
font-family: "NunitoSansSemibold", sans-serif;
font-size: 1rem;
font-weight: 600;
height: 3rem;
@handrihmw
handrihmw / AccordionPreview.vue
Created August 18, 2022 02:50
Accordion Preview
<template>
<div class="container">
<div class="row align-items-center">
<AsAccordion>
<AsAccordionTitle>
<h3 class="as-text-16-bold">
Lorem ipsum dolor sit amet consectetur.
</h3>
</AsAccordionTitle>
<AsAccordionContent>
@handrihmw
handrihmw / AccordionStyle.scss
Last active August 18, 2022 02:51
Accordion Style
:root {
--as-color-white: #fff;
--as-color-divider: #d9dde3;
--as-color-gray-soft: #f3f4f6;
}
.as-accordion {
margin-bottom: 0.875rem;
&__header {
@handrihmw
handrihmw / AccordionContent.vue
Last active August 18, 2022 02:54
Accordion Content
<template>
<div class="as-accordion__body" v-if="visible()">
<div class="as-accordion__content">
<slot />
</div>
</div>
</template>
<script setup>
import { inject } from "vue";