mrodal / vue-inheritance-loader

Webpack loader to be used along with vue-loader for Single File Components that provides template extension
38 stars 5 forks source link

Base path for children templates should be relative to current template #3

Closed mnguyen284 closed 5 years ago

mnguyen284 commented 5 years ago

In case I have a structure like this:

customers
|--- index
     |--- CustomerListPage.vue
shared
|--- pages
     |--- PageBase.vue
     |--- ListPage.vue

My templates should be like

PageBase.vue

<template>
</template>

ListPage.vue

<template extends="./PageBase.vue">
</template>

CustomerListPage.vue

<template extends="../../shared/pages/ListPage.vue">
</template>

But that doesn't work. ListPage.vue must also have the value as ../../shared/pages/Page.vue to make it work.

I found in resolveComponent function you passed initialPath to the children too.

Please have a look.

Thank you.

mrodal commented 5 years ago

Good catch, thanks for reporting the bug. Its fixed (https://github.com/mrodal/vue-inheritance-loader/commit/f62b8d2e5706a19b34828952097730d3bbc97809), please update your package to 0.1.5

mnguyen284 commented 5 years ago

Great! Thanks for the tool.