Vue 将样式绑定到一个对象让模板更清晰

Vue 将样式绑定到一个对象让模板更清晰

    <div id="app">
        <div v-bind:style="styleObject">样式绑定到一个对象</div>
    </div>
    <script>
    new Vue({
        el: '#app',
        data: {
            styleObject: {
                color: 'green',
                fontSize: '30px'
            }
        }
    })
原文地址:https://www.cnblogs.com/F4NNIU/p/9334965.html