Skip to content

Instantly share code, notes, and snippets.

View lbgm's full-sized avatar

Balthazar DOSSOU lbgm

View GitHub Profile
@lbgm
lbgm / pass-slots.md
Created April 16, 2023 15:11 — forked from loilo/pass-slots.md
Vue: Pass Slots through from Parent to Child Components

Vue: Pass Slots through from Parent to Child Components

The Situation

  • We've got some components A, B and C which provide different slots.
    const A = {
      template: `<div><slot name="a">Default A Content</slot></div>`
    }

const B = {

@lbgm
lbgm / typing.vue3js.directive.js
Last active March 7, 2023 17:05
Input HTML Element Typing events handler for "Vue 3", get callback for typing finished and running
/**
* custom typing directive
* pass a function to this Directive, change inputInterval value to increase or decrease reactivity
*/
import type { DirectiveBinding, VNode, VueElement } from "vue";
export const typing = {
beforeMount(el: HTMLInputElement | VueElement, binding: DirectiveBinding, vnode: VNode) {
void vnode;
@lbgm
lbgm / breadcrumbs-class.php
Last active March 31, 2023 11:57
Generate breadcrumbs with PHP, Usable for Google structured data
<?php
#Breadcrumb List Generator
class Breadcrumb
{
public static function c()
{
static $instance;
if(!is_object($instance))
{