Scss, is used in vue components to use components in different situations. How can the value of the style be written?

when components are introduced in different places, the sizes of components are different, and all other styles are the same. Could you tell me how to use scss? at this time?

Mar.05,2021

you can use

in the component

<Item :style="style"></Item>

props:['newStyle']
data(){
 return {
  style:{
      ....
      }
 },
 created() {
  this.style = Object. assign({},this.newStyle,this.style)
 }
}

define style bindings when writing components

example: class= "xxx==1?bigClass:smallClass" component

introduce the value of determining xxx to determine the style

the problem with values is that component communication is not detailed


provides ideas: receive: size, in the component and transfer the size in the parent component;


Why not props to do it? It feels best to pass props to different styles


props to accept style parameters. Super highly customizable


iview button components you can refer to
`classes () {
return [

`${prefixCls}`,
{
  [`${prefixCls}-${this.type}`]: !!this.type,
  [`${prefixCls}-long`]: this.long,
  [`${prefixCls}-${this.shape}`]: !!this.shape,
  [`${prefixCls}-${this.size}`]: !!this.size,
  [`${prefixCls}-loading`]: this.loading != null && this.loading,
  [`${prefixCls}-icon-only`]: !this.showSlot && (!!this.icon || this.loading)
}

]; `

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e522ac-4c898.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e522ac-4c898.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?