小编Imr*_*chi的帖子

仅包含标准库的 Golang 中间件

我的第一个 stackoverflow 问题,所以请不要介意我对 stackoverflow 的天真和所问的问题,golang 的初学者。

我想知道这两个调用之间的区别以及对,,,HandleHandler简单理解。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)

go

5
推荐指数
1
解决办法
1553
查看次数

Vuejs Animate.css 不工作

Vuejs 相对初学者。我正在使用 Animate.css 库进行我想要的过渡。

它在不滚动时基本上是 4 列和 8 列布局,当我滚动时变为 1 和 11。

它没有过渡效果很好,但整体效果不悦目。

这是我用作灵感的 URL

    <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)

任何人都可以提供指示我做错了什么吗?

css css-transitions animate.css vue.js vuejs2

2
推荐指数
2
解决办法
8687
查看次数

标签 统计

animate.css ×1

css ×1

css-transitions ×1

go ×1

vue.js ×1

vuejs2 ×1