biome format --write
This commit is contained in:
parent
8372348148
commit
9262e803ec
415 changed files with 54076 additions and 17419 deletions
|
|
@ -1,7 +1,23 @@
|
|||
import Select from 'src/components/select/select.vue'
|
||||
import Setting from './setting.js'
|
||||
|
||||
export const allCssUnits = ['cm', 'mm', 'in', 'px', 'pt', 'pc', 'em', 'ex', 'ch', 'rem', 'vw', 'vh', 'vmin', 'vmax', '%']
|
||||
export const allCssUnits = [
|
||||
'cm',
|
||||
'mm',
|
||||
'in',
|
||||
'px',
|
||||
'pt',
|
||||
'pc',
|
||||
'em',
|
||||
'ex',
|
||||
'ch',
|
||||
'rem',
|
||||
'vw',
|
||||
'vh',
|
||||
'vmin',
|
||||
'vmax',
|
||||
'%',
|
||||
]
|
||||
export const defaultHorizontalUnits = ['px', 'rem', 'vw']
|
||||
export const defaultVerticalUnits = ['px', 'rem', 'vh']
|
||||
|
||||
|
|
@ -9,47 +25,51 @@ export default {
|
|||
...Setting,
|
||||
components: {
|
||||
...Setting.components,
|
||||
Select
|
||||
Select,
|
||||
},
|
||||
props: {
|
||||
...Setting.props,
|
||||
min: Number,
|
||||
units: {
|
||||
type: Array,
|
||||
default: () => allCssUnits
|
||||
default: () => allCssUnits,
|
||||
},
|
||||
unitSet: {
|
||||
type: String,
|
||||
default: 'none'
|
||||
default: 'none',
|
||||
},
|
||||
step: {
|
||||
type: Number,
|
||||
default: 1
|
||||
default: 1,
|
||||
},
|
||||
resetDefault: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...Setting.computed,
|
||||
stateUnit () {
|
||||
return typeof this.state === 'string' ? this.state.replace(/[0-9,.]+/, '') : ''
|
||||
stateUnit() {
|
||||
return typeof this.state === 'string'
|
||||
? this.state.replace(/[0-9,.]+/, '')
|
||||
: ''
|
||||
},
|
||||
stateValue() {
|
||||
return typeof this.state === 'string'
|
||||
? this.state.replace(/[^0-9,.]+/, '')
|
||||
: ''
|
||||
},
|
||||
stateValue () {
|
||||
return typeof this.state === 'string' ? this.state.replace(/[^0-9,.]+/, '') : ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...Setting.methods,
|
||||
getUnitString (value) {
|
||||
getUnitString(value) {
|
||||
if (this.unitSet === 'none') return value
|
||||
return this.$t(['settings', 'units', this.unitSet, value].join('.'))
|
||||
},
|
||||
updateValue (e) {
|
||||
updateValue(e) {
|
||||
this.configSink(this.path, parseFloat(e.target.value) + this.stateUnit)
|
||||
},
|
||||
updateUnit (e) {
|
||||
updateUnit(e) {
|
||||
let value = this.stateValue
|
||||
const newUnit = e.target.value
|
||||
if (this.resetDefault) {
|
||||
|
|
@ -59,6 +79,6 @@ export default {
|
|||
}
|
||||
}
|
||||
this.configSink(this.path, value + newUnit)
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue