mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-08-08 13:39:46 +08:00
types: use CSSProperties for style
This commit is contained in:
parent
59fb1d4dfc
commit
ed753ac97d
@ -1,4 +1,4 @@
|
|||||||
import { PropType } from 'vue';
|
import { PropType, CSSProperties } from 'vue';
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import { createNamespace } from '../utils';
|
import { createNamespace } from '../utils';
|
||||||
@ -114,7 +114,7 @@ export default createComponent({
|
|||||||
const getStyle = () => {
|
const getStyle = () => {
|
||||||
const { color, plain } = props;
|
const { color, plain } = props;
|
||||||
if (color) {
|
if (color) {
|
||||||
const style: Record<string, string> = {};
|
const style: CSSProperties = {};
|
||||||
|
|
||||||
style.color = plain ? color : WHITE;
|
style.color = plain ? color : WHITE;
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ export default createComponent({
|
|||||||
|
|
||||||
// hide border when color is linear-gradient
|
// hide border when color is linear-gradient
|
||||||
if (color.indexOf('gradient') !== -1) {
|
if (color.indexOf('gradient') !== -1) {
|
||||||
style.border = '0';
|
style.border = 0;
|
||||||
} else {
|
} else {
|
||||||
style.borderColor = color;
|
style.borderColor = color;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { ref, watch, computed, PropType } from 'vue';
|
import { ref, watch, computed, PropType, CSSProperties } from 'vue';
|
||||||
import { createNamespace, isDef, addUnit } from '../utils';
|
import { createNamespace, isDef, addUnit } from '../utils';
|
||||||
import Icon from '../icon';
|
import Icon from '../icon';
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ export default createComponent({
|
|||||||
const imageRef = ref();
|
const imageRef = ref();
|
||||||
|
|
||||||
const style = computed(() => {
|
const style = computed(() => {
|
||||||
const style: Record<string, unknown> = {};
|
const style: CSSProperties = {};
|
||||||
|
|
||||||
if (isDef(props.width)) {
|
if (isDef(props.width)) {
|
||||||
style.width = addUnit(props.width);
|
style.width = addUnit(props.width);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { computed } from 'vue';
|
import { computed, CSSProperties } from 'vue';
|
||||||
import { createNamespace, isDef } from '../utils';
|
import { createNamespace, isDef } from '../utils';
|
||||||
import Badge from '../badge';
|
import Badge from '../badge';
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ export default createComponent({
|
|||||||
|
|
||||||
setup(props) {
|
setup(props) {
|
||||||
const style = computed(() => {
|
const style = computed(() => {
|
||||||
const style: Record<string, string> = {};
|
const style: CSSProperties = {};
|
||||||
const {
|
const {
|
||||||
type,
|
type,
|
||||||
color,
|
color,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user