<template>
    <div :class="['static-class', { 'dynamic-class1': condition1, 'dynamic-class2': condition2 }]">
        这是一个元素
    </div>
</template>

<script>
export default {
    data() {
        return {
            condition1: false,
            condition2: false,
        };
    },
    watch: {
        // 假设某个值变化时触发条件判断
        someValue() {
            this.condition1 = this.someValue > 10;
            this.condition2 = this.someValue < 5;
        },
    },
};
</script>