我的第一个 stackoverflow 问题,所以请不要介意我对 stackoverflow 的天真和所问的问题,golang 的初学者。
我想知道这两个调用之间的区别以及对,,,Handle的Handler简单理解。HandleFuncHandlerFunc
http.Handle("/profile", Logger(profilefunc))
http.HandleFunc("/", HomeFunc)
func main() {
fmt.Println("Starting the server.")
profilefunc := http.HandlerFunc(ProfileFunc)
http.Handle("/profile", Logger(profilefunc))
http.HandleFunc("/", HomeFunc)
http.ListenAndServe("0.0.0.0:8081", nil)
}
func Logger(h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request){
log.Println("Before serving request")
h.ServeHTTP(w, r)
log.Println("After serving request")
})
}
func ProfileFunc(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "You are on the profile page.")
}
func HomeFunc(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello Imran Pochi")
}
Run Code Online (Sandbox Code Playgroud) Vuejs 相对初学者。我正在使用 Animate.css 库进行我想要的过渡。
它在不滚动时基本上是 4 列和 8 列布局,当我滚动时变为 1 和 11。
它没有过渡效果很好,但整体效果不悦目。
<div class="column is-4 is-hidden-touch" v-show="! isScroll">
<navcomponent :navScroll = "isScroll"></navcomponent>
</div>
<div class="column is-8" v-show=" ! isScroll">
<maincontent></maincontent>
</div>
<transition enter-active-class="animated fadeIn" leave-active-class="animated fadeOut" mode="out-in">
<div class="column is-1 is-hidden-touch" v-show="isScroll">
<navcomponent :navScroll = "isScroll"></navcomponent>
</div>
</transition>
<transition enter-active-class="animated fadeIn" leave-active-class="animated fadeOut" mode="out-in">
<div class="column is-11" v-show=" isScroll">
<maincontent></maincontent>
</div>
</transition>
Run Code Online (Sandbox Code Playgroud)
任何人都可以提供指示我做错了什么吗?