You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
663 B
Vue

<template>
<el-card> 动态导入js模块示例 </el-card>
</template>
<script setup lang="jsx">
import { onMounted } from 'vue';
import dynamicImportModule from './index.js';
defineOptions({
name: 'DynamicImport',
});
onMounted(() => {
dynamicImportModule('moduleA', { name: 'dynamicModuleA', type: 'init' }).then((res) => {
console.log('拿到异步加载成功之后的返回结果', res);
});
// dynamicImportModule('moduleA', { name: 'dynamicModuleA', type: 'getData' }).then((res) => {
// console.log('拿到异步加载成功之后的返回结果', res);
// });
});
</script>
<style lang="scss" scoped></style>