Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
285 views
in Technique[技术] by (71.8m points)

javascript - Display Flex Property is not Taken On Vue Scoped scss , Why?

hi i have following code with vue formulate form

  <template>
  <div class="repeatable-container">
    <FormulateForm>
      <FormulateInput type="text" label="strength" placeholder="strength" />
      <FormulateInput type="select" label="Quantity" placeholder="strength" />
      <FormulateInput
        type="select"
        label="Method of intake"
        placeholder="strength"
      />
      <span>Remove Dossage</span>
    </FormulateForm>
  </div>
</template>

<script>
export default {
  name: "RepeatableGroup",
};
</script>

//When scoped on style flex property of .formulate-input-wrapper is not taking but it takes if i remove it ,Can any body got idea? 
<style lang="scss" scoped >
.repeatable-container {
  .formulate-form,
  .formulate-input-wrapper {
    display: flex !important;
  }
}
.formulate-input-wrapper {
  display: flex !important;
}
</style>

here is the image

with scoped attribute on style

without the scoped attribute on style flex property is accessible

question from:https://stackoverflow.com/questions/65860604/display-flex-property-is-not-taken-on-vue-scoped-scss-why

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

That's because with scoped , the parent component's styles do not leak into child components.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...