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

Use of width in percentage #26

Open
whimsicaldreamer opened this issue Jun 1, 2021 · 0 comments
Open

Use of width in percentage #26

whimsicaldreamer opened this issue Jun 1, 2021 · 0 comments

Comments

@whimsicaldreamer
Copy link

whimsicaldreamer commented Jun 1, 2021

@nikitasnv I am trying to use this component for a dashboard, but my present needs require me to use width in percentages. Is it possible to do this? The following is how I tried creating a component but the issue arises when I try setting a certain width in percentage by selecting the value from the dropdown.

<template>
  <vue-resizable 
    :min-width="320"
    :width="containerWidth + '%'" 
    :active="['r']"
    
  >
    <div class="resizable-content">
      <pre>{{ containerWidth }}</pre>

      <select v-model="containerWidth">
        <option :value="75">75%</option>
        <option :value="50">50%</option>
      </select>

      <slot></slot>
    </div>
  </vue-resizable>
</template>

<script>
import VueResizable from 'vue-resizable'

export default ({
  name: 'resizeableContainer',
  components: {VueResizable},
  props: ['width'],
  data () {
    return {
      containerWidth: this.width
    }
  }
})
</script>

<style scoped>
  .resizable-content {
    width: 100%;
    height: 100%;
    background-color: aqua;
  }
</style>
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

1 participant