vue2转vue3的问题 #11785
Unanswered
u32744
asked this question in
Help/Questions
vue2转vue3的问题
#11785
Replies: 2 comments
-
报错: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
`const requireApi = require.context(
//api 目录的相对路径
'.',
//是否查询子路径
false,
//查询文件的一个后缀
/.js$/
)
console.log("-----------------------------------------requireApi.keys()");
console.log(requireApi.keys());
let module = {}
requireApi.keys().forEach((key,index)=>{
// console.log(key);
if(key === './index.js') return
console.log("----------------key---------------------");
console.log(key);
Object.assign(module,requireApi(key))
})
console.log("------------------modeule");
console.log(module);
export default module`
上面是VUE2 的代码, 现在是VUE3环境, 该怎么写?
Beta Was this translation helpful? Give feedback.
All reactions