Skip to content

Instantly share code, notes, and snippets.

View kathirr007's full-sized avatar

Kathiravan K kathirr007

View GitHub Profile
@kathirr007
kathirr007 / pass-slots.md
Created July 9, 2024 14:47 — 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 = {

@kathirr007
kathirr007 / xmlToJson.js
Created August 20, 2021 09:30 — forked from chinchang/xmlToJson.js
Function to convert XML to JSON
/**
* Changes XML to JSON
* Modified version from here: http://davidwalsh.name/convert-xml-json
* @param {string} xml XML DOM tree
*/
function xmlToJson(xml) {
// Create the return object
var obj = {};
if (xml.nodeType == 1) {