Methods commonly used vue

<input  v-for="item,i  in  tabData "
			type="button"
			v-bind:value="item.title"
			v-bind:class="{ative : i=== index}"
/>

controllable

class

v-bind: class = "{class name: Expression}"
v-bind:class="{ative : i=== index}"

style

v-bind: style = "{style name: style value}"
v-bind:style="{display : i ===index ? 'black' : 'none'}"

v-on:click

@click="tabClick(i)"
@click="tabClick( $event, 123 )// method to mass participation events in the template, you need to manually use $eventthe event object passed to the method

Guess you like

Origin blog.csdn.net/gqzydh/article/details/89504618