Wujingquan | 搞搞震

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 »