<template>
    <!-- 管理端 -->
    <div class="iframe-container">
        <iframe :src="url" style="border: 0" title="mtp"></iframe>
    </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import { onBeforeRouteLeave } from 'vue-router';
import { getIframeUrl } from './setup';
import { QueryDeliveryGoodsDetail } from '@/services/go/ermcp/goodsInfo/index';

export default defineComponent({
    setup() {
        onBeforeRouteLeave((to, from, next) => {
            // 路由跳转查询现货商品，解决新增商品后本地缓存无数据
            if (from.path.includes('/info/goods')) {
                QueryDeliveryGoodsDetail();
            }
            next();
        });
        return {
            ...getIframeUrl(),
        };
    },
});
</script>