示例仅供参考,请以真机为主

Page 页面组件

由于 uniapp 限制,该组件可作为全局组件使用。添加了该组件后,即可使用 ui 内的方法:

方法

事件名称说明参数
showToast打开提示框function(options: ClToast.Options)
showConfirm打开确认框function(options: ClConfirm.Options)
showLoading打开加载框function(text: string)
hideLoading关闭加载框function()
<template>
	<cl-page>
		<view class="page-home">
			<!-- 内容 -->
		</view>
	</cl-page>
</template>

<script lang="ts" setup>
	import { useCool } from "/@/cool";

	const { ui } = useCool();

	function open() {
		ui.showToast();
	}
</script>

如需修改组件,编辑文件/cool/ui/components/cl-page/cl-page.vue

Last Updated: