Element-ui - 禁用 el-tag 上的动画
Element-ui - disable animation on el-tag
我一直在深入研究代码,但无法弄清楚进入动画的来源:
这里是 fiddle:http://jsfiddle.net/eywraw8t/471037/
fiddle代码:
.html
<div id="app">
<input type="checkbox" v-model="showUndone"> <label>Show undone ?</label>
<ol>
<li v-for="todo in todos" v-if="todo.done || !todo.done && showUndone">
<el-tag>{{todo.text}}</el-tag>
</li>
</ol>
</div>
.js
new Vue({
el: "#app",
data: {
showUndone: false,
todos: [
{ text: "Learn JavaScript", done: false },
{ text: "Learn Vue", done: false },
{ text: "Play around in JSFiddle", done: true },
{ text: "Build something awesome", done: true }
]
},
methods: {
toggle: function(todo){
todo.done = !todo.done
}
}
})
<el-tag>
转换默认开启。使用属性 disable-transitions
禁用:
<div id="app">
<input type="checkbox" v-model="showUndone"> <label>Show undone ?</label>
<ol>
<li v-for="todo in todos" v-if="todo.done || !todo.done && showUndone">
<el-tag disable-transitions>{{todo.text}}</el-tag>
</li>
</ol>
</div>
我一直在深入研究代码,但无法弄清楚进入动画的来源:
这里是 fiddle:http://jsfiddle.net/eywraw8t/471037/
fiddle代码:
.html
<div id="app">
<input type="checkbox" v-model="showUndone"> <label>Show undone ?</label>
<ol>
<li v-for="todo in todos" v-if="todo.done || !todo.done && showUndone">
<el-tag>{{todo.text}}</el-tag>
</li>
</ol>
</div>
.js
new Vue({
el: "#app",
data: {
showUndone: false,
todos: [
{ text: "Learn JavaScript", done: false },
{ text: "Learn Vue", done: false },
{ text: "Play around in JSFiddle", done: true },
{ text: "Build something awesome", done: true }
]
},
methods: {
toggle: function(todo){
todo.done = !todo.done
}
}
})
<el-tag>
转换默认开启。使用属性 disable-transitions
禁用:
<div id="app">
<input type="checkbox" v-model="showUndone"> <label>Show undone ?</label>
<ol>
<li v-for="todo in todos" v-if="todo.done || !todo.done && showUndone">
<el-tag disable-transitions>{{todo.text}}</el-tag>
</li>
</ol>
</div>