Skip to content

Conversation

@Craga89
Copy link

@Craga89 Craga89 commented Nov 15, 2014

Currently it's not possible to apply multiple classes in the v-class directive without specifying each class statically as keys. This pull request enables the parameter to v-class to be a space separated list of classes to apply, which can be built up within a computed property (or similar).

Example use case:

new Vue({ el: '#shell', data: function() { return { type: 'foo', subtype: 'bar' } }, computed: { classList: function() { return [this.type, this.subtype].join(' '); } } });
<div id="shell" v-class="classList"></div>

Fiddle here: http://jsfiddle.net/o2twwvsn/

Add support for space separated list of classes to the `addClass` and `removeClass` util methods, enabling multiple class support in `v-class`
@Craga89 Craga89 closed this Nov 15, 2014
@Craga89
Copy link
Author

Craga89 commented Nov 15, 2014

Ignored htis! It can be done using class="{{classList}}" as demonstrated in the bug: https://github.com/yyx990803/vue/issues/563

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant