_TL;DR: You can use arrow functions that return slot function calls to render scoped slots in the render function returned by setup
. [Here's an SFC playground](https://sfc.vuejs.org/#eyJBcHAudnVlIjoiPHNjcmlwdD5cbmltcG9ydCB7IHJlZiB9IGZyb20gJ3Z1ZSdcblxuY29uc3QgV2l0aFJlbmRlckZuID0ge1xuXHRzZXR1cCAocHJvcHMsIHsgc2xvdHMgfSkge1xuICAgIGNvbnN0IGNvdW50ID0gcmVmKDApXG4gICAgXG4gICAgcmV0dXJuICgpID0+IHNsb3RzLmRlZmF1bHQoe1xuICAgICAgY291bnQ6IGNvdW50LnZhbHVlLFxuICAgICAgb25DbGljazogKCkgPT4gY291bnQudmFsdWUrKyxcbiAgICB9KVxuICB9XG59XG5cbmV4cG9ydCBkZWZhdWx0IHtcbiAgY29tcG9uZW50czoge1xuICAgIFdpdGhSZW5kZXJGbixcbiAgfVxufVxuPC9zY3JpcHQ+XG5cbjx0ZW1wbGF0ZT5cbiAgPFdpdGhSZW5kZXJGbiB2LXNsb3Q9XCJ7IGNvdW50LCBvbkNsaWNrIH1cIj5cblx0ICA8ZGl2IHN0eWxlPVwiZGlzcGxheTogZmxleDsgZ2FwOiAxcmVtO1wiPlxuXHRcdCAgPHNwYW4+Y291bnQgaXM6IHt7IGNvdW50IH19PC9zcGFuPlxuICBcdCAgPGJ1dHRvbiA6b25DbGljaz1cIm9uQ2xpY2tcIj5cbiAgICBcdCAgQ291bnQgdXBcbiAgICBcdDwvYnV0dG9uPlxuXHQgIDwvZGl2PlxuICA8L1dpdGhSZW5kZXJGbj5cbjwvdGVtcGxhdGU+Iiwi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const chaosTestStrings = (): void => { | |
const textNodes = getAllTextNodes(document.body); | |
for (const node of textNodes) { | |
const textNodeLength = node.textContent ? node.textContent.length : 0; | |
if (node.textContent === null) { | |
return; | |
} | |
if (node.parentElement instanceof Element) { | |
if (node.parentElement.dataset.originalText === undefined) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { z } from 'zod' | |
function safeParseJSON ( string: string ): any { | |
try { return JSON.parse( string ) } | |
catch { return string } | |
} | |
function searchParamsToValues ( searchParams: URLSearchParams ): Record<string, any> { | |
return Array.from( searchParams.keys() ).reduce( ( record, key ) => { | |
const values = searchParams.getAll( key ).map( safeParseJSON ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useNuxtApp } from '#app' | |
import { sendRedirect } from 'h3' | |
/** | |
* Performs an external redirect in a Nuxt3 route middleware. Once this Nuxt3 | |
* pull request is merged, this function can be removed in favor of navigateTo: | |
* | |
* https://github.com/nuxt/framework/pull/5022 | |
* | |
* @param url - An external url to redirect to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Made by Elly Loel - https://ellyloel.com/ | |
With inspiration from: | |
- Josh W Comeau - https://courses.joshwcomeau.com/css-for-js/treasure-trove/010-global-styles/ | |
- Andy Bell - https://piccalil.li/blog/a-modern-css-reset/ | |
- Adam Argyle - https://unpkg.com/[email protected]/normalize.min.css / https://codepen.io/argyleink/pen/KKvRORE | |
Notes: | |
- `:where()` is used to lower specificity for easy overriding. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { nextTick } from 'vue' | |
export const useProperCookie = () => useCookie('proper_token') | |
export const useAuthFetch = (url, fetchOptions = {}) => { | |
return $fetch(url, { | |
baseURL: 'https://l9.test/api/v1', | |
...fetchOptions, | |
headers: { | |
Authorization: `Bearer ${useProperCookie().value}`, | |
...fetchOptions.headers, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Snippet for Directus' custom endpoint (tested on v9.8.0) | |
// This snippet checks if a role named "Homepage" is present and authenticates with it to execute custom logic | |
// In this case, it returns an image if the role has sufficient permissions. | |
// It's pretty barebone, but should get you started. | |
const { getPermissions } = require('directus/utils/get-permissions'); | |
const { getSchema } = require('directus/utils/get-schema'); | |
module.exports = function registerEndpoint(router, { services, exceptions, database }) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Mark, markInputRule, markPasteRule } from '@tiptap/core'; | |
export const kbdInputRegex = /(?:^|\s)((?:<kbd>)((?:[^*]+))(?:<\/kbd>))$/; | |
export const kbdPasteRegex = /(?:^|\s)((?:<kbd>)((?:[^*]+))(?:<\/kbd>))/g; | |
export const Kbd = Mark.create({ | |
name: 'kbd', | |
excludes: '_', | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { defineStore } from 'pinia' | |
export const useAuthStore = defineStore({ | |
id: 'auth', | |
state: () => ({ | |
isAuthenticated: false, | |
user: null | |
}), | |
actions: { | |
async nuxtServerInit() { |
sudo apt install git-all
https://docs.github.com/en/developers/overview/managing-deploy-keys#deploy-keys