<template>
	<pyh-nv :config="config"></pyh-nv>

</template>

<script setup>
	import {
		ref,
		defineProps,
		watch,
		reactive,
		defineEmits,
		defineExpose
	} from 'vue';
	const props = defineProps();

	const config = reactive({
		title: '',
		back: {
			hide: false, //是否隐藏导航按钮
			iconForce: true //是否出现返回按钮
		},
		bgImage: '../../../../static/标题栏.jpg',
	})

	watch(
		() => props.title, 
		(val, prevVal) => {
			config.title = val
		}, {
			immediate: true,
			deep: true
		}
	);

	watch(
		() => props.iconForce, 
		(val, prevVal) => {
			config.back.hide = val
		}, {
			// immediate: true,
			deep: true
		}
	);

	const changeTitle = (e) => {
		config.title = e
	}

	defineExpose({
		changeTitle
	})
</script>

<style>


</style>