Vue-cli cannot use slot to achieve content distribution after dynamically registering components with webpack

  • content distribution cannot be implemented using slot after dynamically registering components with webpack
  • there is no problem with a separate registration component. I don"t know what the problem is
  • the following is the webpack dynamic registration component code
import Vue from "vue";

function capitalizeFirstLetter(string) {
    return string.charAt(0).toUpperCase() + string.slice(1);
}

const requireComponent = require.context(
    ".",
    true,
    /\.vue$/
);

requireComponent.keys().forEach(fileName => {
    console.log(`${fileName.substring(fileName.lastIndexOf("/")  + 1).replace(/\.\w+$/, "")}      :"${fileName}"`);
    const componentConfig = requireComponent(fileName);
    const componentName = capitalizeFirstLetter(
        fileName.substring(fileName.lastIndexOf("/")  + 1).replace(/\.\w+$/, "")
    );
    Vue.component(componentName, componentConfig.default || componentConfig);
});
Mar.23,2021

resolved, non-webpack problem

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-3431e9e-170f7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-3431e9e-170f7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?