2460392754/uniapp-router-view-loader

页面中存在插槽时错误

Closed this issue · 2 comments

return source.replace(/(<\/view>)([\s|S]+)(<\/template>)/, (s) => code + s);

App.vue

<template>
    <view>My Header1</view>
    <view>My Header2</view>
    <view-router />
    <view>My Footer1</view>
    <view>My Footer2</view>
</template>

页面代码

<template>
    <view class="content">
        <u-navbar bgColor="transparent">
            <template v-slot:left>
                <view class="nav-bar-text">首页</view>
            </template>
        </u-navbar>
        ...
    </view>
</template>

插件修改后的代码

<template>
    <view class="content"><view>My Header1</view><view>My Header2</view>
        <u-navbar bgColor="transparent">
            <template v-slot:left>
                <view class="nav-bar-text">首页<view>My Footer1</view><view>My Footer2</view></view>
            </template>
        </u-navbar>
        ...
    </view>
</template>

在bug修复之前可以先试试用block标签

@qzsiniong 已修复