Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

css作用域问题 #290

Open
LiangFuzhi opened this issue Aug 8, 2019 · 1 comment
Open

css作用域问题 #290

LiangFuzhi opened this issue Aug 8, 2019 · 1 comment

Comments

@LiangFuzhi
Copy link

<template>
  <block>
      <div  class="btn">
        <slot>
          <mp-scale :scale="scale">
            <div class="flex">+</div>
          </mp-scale>
        </slot>
      </div>
    </block>
</template>
<style lang="less" scoped>
.btn {
  width: 100%;
  height: 100%;
}
.flex {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
</style>

css作用域有问题
image
flex不生效,这种写法应该生效才对

<template>
  <block>
      <div  class="btn">
          <mp-scale :scale="scale">
            <div class="flex">+</div>
          </mp-scale>
      </div>
    </block>
</template>

这样子flex就生效了

@bigmeow
Copy link

bigmeow commented Aug 16, 2019

把 scoped 去掉 , scoped 有些问题, 暂不建议使用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants