Closed
Description
Version
15.4.0
Reproduction link
Steps to reproduce
- Create project by vue-cli
- Create two components and mount the `Bar``.
Foo:
......
<style module lang="scss">
.root {
color: red;
}
</style>
Bar:
<template>
<div :class="$style.root">
There should be black.
</div>
</template>
<script>
import GameCard from './GameCard.vue';
export default {
extends: Foo
};
</script>
<style module lang="scss">
.root {
color: black;
}
</style>
- Run
npm run serve
.
What is expected?
No error and the color is black.
What is actually happening?
TypeError: Cannot redefine property: $style
I think here should be:
Object.defineProperty(this, ${name}, {
configurable: true, // !
get: function () {
return cssModules[${name}]
}
})