{"id":981,"date":"2023-03-23T22:41:43","date_gmt":"2023-03-23T14:41:43","guid":{"rendered":""},"modified":"2023-03-23T22:41:43","modified_gmt":"2023-03-23T14:41:43","slug":"Vue.js \u8fc7\u6e21","status":"publish","type":"post","link":"https:\/\/bianchenghao6.com\/981.html","title":{"rendered":"Vue.js \u8fc7\u6e21"},"content":{"rendered":"
\n
\u5b83\u63d0\u4f9b\u4e86\u7c7b\uff0c\u5e76\u81ea\u52a8\u5c06\u8fd9\u4e9b\u7c7b\u5e94\u7528\u4e8eCSS\u8fc7\u6e21\u548c\u52a8\u753b\u3002<\/span> <\/body>
\n \u5b83\u53ef\u4ee5\u96c6\u6210\u7b2c\u4e09\u65b9CSS\u52a8\u753b\u5e93\uff0c\u4f8b\u5982Animate.css\u3002<\/span>
\n \u5b83\u53ef\u4ee5\u4f7f\u7528JavaScript\u5728\u8fc7\u6e21\u6302\u94a9\u671f\u95f4\u76f4\u63a5\u64cd\u4f5cDOM\u3002<\/span>
\n \u5b83\u53ef\u4ee5\u96c6\u6210\u7b2c\u4e09\u65b9JavaScript\u52a8\u753b\u5e93\uff0c\u4f8b\u5982Velocity.js\u3002<\/span> <\/p>\n Vue.js\u8fc7\u6e21<\/h3>\n
<transition name = \"name_of_the_transition\">
<div><\/span><\/div><\/span>
<\/transition>
<\/span><\/code><\/pre>\n<\/p><\/div>\n Vue.js\u6de1\u5165\u8fc7\u6e21<\/h3>\n
<html><\/span>
<head><\/span>
<title><\/span>Vue.js Transition<\/title><\/span>
<link rel=\"stylesheet\" href=\"index.css\">
<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue\/dist\/vue.js\"><\/script><\/span>
<\/head><\/span>
<body><\/span>
<style><\/span>
.fade-enter-active, .fade-leave-active {
transition: opacity 3s
}
.fade-enter, .fade-leave-to \/* .fade-leave-active below version 2.1.8 *\/ {
opacity: 0
}
<\/style><\/span>
<div id = \"databinding\">
<p><\/span> Click at the below button to see transition effect.<\/p><\/span>
<button v-on:click = \"show = !show\">Click Here<\/button><\/span>
<transition name = \"fade\">
<p v-show = \"show\" v-bind:style = \"styleobj\">This is a Fade Transition Example<\/p><\/span>
<\/transition>
<\/div><\/span>
<\/script><\/span>
<script src=\"index.js\"><\/script><\/span>
<\/body><\/span>
<\/html><\/span>
<\/span><\/code><\/pre>\n<\/p><\/div>\n var vm = new Vue({
el: '#databinding',
data: {
show:true,
styleobj :{
fontSize:'30px',
color:'red'
}
},
methods : {
}
})
<\/span><\/code><\/pre>\n<\/p><\/div>\n
\n CSS \u6587\u4ef6\u4f7f\u8f93\u51fa\u66f4\u5177\u5438\u5f15\u529b\u3002\n <\/div>\n html, body {
margin: 5px;
padding: 0;
}
<\/span><\/code><\/pre>\n<\/p><\/div>\n <\/p>\n
<\/p>\n
\u793a\u4f8b\u8bf4\u660e<\/h3>\n
<transition name = \"fade\">
<p v-show = \"show\" v-bind:style = \"styleobj\">This is a Fade Transition Example<\/p><\/span>
<\/transition>
<\/span><\/code><\/pre>\n<\/p><\/div>\n
\n \u6e10\u53d8\u8fc7\u6e21<\/strong>\u7684\u793a\u4f8b\u3002\u4ee5\u4e0b\u662f\u8fc7\u6e21\u4e2d\u4f7f\u7528\u7684\u4e00\u4e9b\u6807\u51c6\u7c7b\u7684\u5217\u8868:\n <\/div>\n Vue.js shiftx\u8fc7\u6e21<\/h3>\n
\n shiftx <\/strong>\u8fc7\u6e21\u3002\u6b64transform\u5c5e\u6027\u4f1a\u5c06x\u8f74\u4e0a\u7684\u56fe\u50cf\u79fb\u52a8100px\u3002\u8bf7\u53c2\u89c1\u4ee5\u4e0b\u793a\u4f8b:\n <\/div>\n <html><\/span>
<head><\/span>
<title><\/span>Vue.js Transition<\/title><\/span>
<link rel=\"stylesheet\" href=\"index.css\">
<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue\/dist\/vue.js\"><\/script><\/span>
<\/head><\/span>
<body><\/span>
<style><\/span>
.shiftx-enter-active, .shiftx-leave-active {
transition: all 2s ease-in-out;
}
.shiftx-enter, .shiftx-leave-to \/* .fade-leave-active below version 2.1.8 *\/ {
transform : translateX(100px);
}
<\/style><\/span>
<div id = \"databinding\">
<p><\/span> Click at the below button to see transition effect.<\/p><\/span>
<button v-on:click = \"show = !show\">Click Here<\/button><\/span>
<transition name = \"shiftx\">
<p v-show = \"show\">
<img src = \"https:\/\/www.flowerpower.com.au\/media\/catalog\/product\/image\/287189f77f\/love-you-rose.jpg\" style = \"width:100px;height:100px;\" \/>
<\/p><\/span>
<\/transition>
<\/div><\/span>
<\/script><\/span>
<script src=\"index.js\"><\/script><\/span>
<\/body><\/span>
<\/html><\/span>
<\/span><\/code><\/pre>\n<\/p><\/div>\n var vm = new Vue({
el: '#databinding',
data: {
show:true
},
methods : {
}
})
<\/span><\/code><\/pre>\n<\/p><\/div>\n <\/p>\n
<\/p>\n
\n
\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"Vue.js \u8fc7\u6e21zh-cn","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[122],"tags":[],"class_list":["post-981","post","type-post","status-publish","format-standard","hentry","category-vuejc"],"_links":{"self":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/981"}],"collection":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/comments?post=981"}],"version-history":[{"count":0,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/981\/revisions"}],"wp:attachment":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/media?parent=981"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/categories?post=981"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/tags?post=981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}