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

Adding text size prop #60

Open
covert8 opened this issue Jan 8, 2020 · 2 comments
Open

Adding text size prop #60

covert8 opened this issue Jan 8, 2020 · 2 comments

Comments

@covert8
Copy link

covert8 commented Jan 8, 2020

Hi, i'm trying to add a prop to influence .treeclass .nodetree text

The way i'm trying to do this is via a computed value and prop. But I can't find where the HTML is defined to add the v-bind:style. Where would I find the template or how would you go about this?

@guog
Copy link

guog commented Jun 1, 2020

use css,

scss

.tree {
  & ::v-deep {
    text {
      font-family: 'Roboto', 'Helvetica Neue', 'Helvetica', 'PingFang SC',
        'Hiragino Sans GB', 'Microsoft YaHei',Arial, sans-serif !important;
      font-size: 12px;
    }
  }
}

@emelendez
Copy link

my way:

<style>
  .treeclass .nodetree text {
    font-size: inherit;
  }
</style>

now the font size depends on the component (parent) style, where you can change dynamically:

<tree
      ref="myTree"
      zoomable
      :style="{fontSize: `${propOrData}rem`}"
      ...
    />

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

3 participants