Vue.D3.tree icon indicating copy to clipboard operation
Vue.D3.tree copied to clipboard

Adding text size prop

Open covert8 opened this issue 5 years ago • 2 comments

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?

covert8 avatar Jan 08 '20 12:01 covert8

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;
    }
  }
}

guog avatar Jun 01 '20 04:06 guog

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`}"
      ...
    />

emelendez avatar Jul 12 '21 13:07 emelendez