Wujingquan | 搞搞震

I don’t know what the title is

JavaScript [1, 2, 3, 4].reduce((a, b) => a + b, 0) _.sum([1, 2, 3, 4]) This article is reprinted from https://www.wujingquan.com/posts/96482e79.html This site is for inclusion only, and the copyright belongs to the original author.

NodeJS

The difference between the methods or attributes used to represent paths, such as __dirname , __filename , etc. in NodeJS __dirname The absolute path of the current file, which will not change with the directory where the command is executed __filename The absolute path of the current file, which will not change with the directory …

NodeJS Read More »

Analysis of Nuxt3 ClientOnly component source code

packages/src/app/components/client-only.mjs export default defineComponent({ name: ‘ClientOnly’, // eslint-disable-next-line vue/require-prop-types props: [‘fallback’, ‘placeholder’, ‘placeholderTag’, ‘fallbackTag’], setup (_, { slots }) { const mounted = ref(false) onMounted(() => { mounted.value = true }) return (props) => { if (mounted.value) { return slots.default?.() } const slot = slots.fallback || slots.placeholder if (slot) { return slot() } const fallbackStr …

Analysis of Nuxt3 ClientOnly component source code Read More »