uniapp export default
时间: 2023-09-06 07:09:26 浏览: 157
export 与 export default 区别
在Uniapp中,export default用于导出一个模块的默认输出。在一个文件中,可以使用export default来导出一个默认的数据对象或组件。例如,在default模块中,可以这样定义一个数据对象:
```
<script>
export default {
data() {
return {
// 数据对象
}
},
methods: {
// 方法
}
}
</script>
```
这样,在其他地方引入这个模块时,就可以直接使用import语句来导入并使用这个默认的数据对象或组件了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [自学uni-app (2)uni-app的导出模块(export default)和常用方法](https://blog.csdn.net/Sim_perfect/article/details/107808265)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [export 与 export default 区别](https://download.csdn.net/download/weixin_38736562/14043578)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [uni-app export与export default用法](https://blog.csdn.net/wusejiege6/article/details/104911528)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文