Skip to content

Different behavior in style insertion order between vue-cli2 and vue-cli3 #4038

Closed
@hangaoke1

Description

@hangaoke1

version

  • 2.x
  • @vue/cli-service@^3.7.0

Environment info

Different behavior with same code
avatar
avatar

Steps to reproduce

vue create vue-project-v4
vue init vue-project-v3

// hello-world.vue
<template>
  <div class="test-find">
    <h1>test-find cli@3</h1>
    <x-span></x-span>
  </div>
</template>

<script>
import xSpan from './x-span.vue'
export default {
  components: {
    xSpan
  }
}
</script>
<style lang="less">
.test-span {
  color: green;
}
</style>
// x-span.vue
<template>
  <div class="x-span">
    <h1 class="test-span">hello world</h1>
  </div>
</template>
<script>
export default {
  name: 'x-span'
}
</script>

<style lang="less">
.test-span {
  color: blue;
}
</style>

What is expected?

both hello world has same color style

What is actually happening?

in v4 the hello world color is green
in v3 the hello world color is blue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions