S
S
samrambling2021-03-27 14:30:06
Vue.js
samrambling, 2021-03-27 14:30:06

How to resize vue 2 cli child component?

Hello, I have a component

<template>
  <div class="frame">
  </div>
</template>
<style lang="scss" scoped>
.frame {
height:100%;
width:100%;
}
</style>
<script>
export default {
  name: "Auth",
};
</script>

and there is a page
<template>
  <div><Auth></Auth></div>
</template>

<style lang="scss" scoped>

Auth {
  width: 50vmin; //не работает
}
</style>

<script>
import Auth from "@/components/Auth.vue";

export default {
  name: "Authorization",
  components: {
    Auth,
  },
};
</script>

but how can i resize the auth block? So that it was not on the whole page?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-03-27
@Aleksandr-JS-Developer

Because the compiled CSS will eventually try to put a class on the Auth tag, but it will not be in the markup.
Try like this:

... template
  <div><Auth class="Auth"></Auth></div>
...

... styles
.Auth {
  width: 50vmin; //не работает
}
...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question