我正在尝试在v-html中使用组件。我想从自己的API获取html,然后将进行演示。
这是我的代码。
HTML:
<!-- app -->
<div id="app">
<span v-html="html"></span>
<badge></badge>
<span v-html="html2"></span>
<partial name="my-partial"></partial>
<span v-html="html3"></span>
</div>
Run Code Online (Sandbox Code Playgroud)
Javascript:
Vue.component('badge', {
template: '<span class="component-tag">This is component</span>',
})
Vue.partial('my-partial', '<p>This is a partial!</p>')
// start app
new Vue({
el: '#app',
data: {
html: '<p>THIS IS HTML</p>',
html2: '<badge></badge>',
html3: '<partial name="my-partial"></partial>'
}
})
Run Code Online (Sandbox Code Playgroud)
https://jsfiddle.net/9w3kz6xm/4/
我尝试了partial,因为Vue文档说:“如果您需要重用模板,则应该使用partials。”
这是行不通的。也许我在犯错误,我不知道什么是错误。
谢谢。
我试图在Windows上的Ubuntu上使用Bash中的AppEngine SDK for Go,但是我有一个错误.这是我的代码.
的app.yaml
runtime: go
api_version: go1
handlers:
- url: /.*
script: _go_app
Run Code Online (Sandbox Code Playgroud)
main.go
package main
import (
"net/http"
"github.com/labstack/echo"
"github.com/labstack/echo/engine/standard"
)
func init() {
e := echo.New()
e.GET("/", func(c echo.Context) error {
return c.String(http.StatusOK, "Hello, World!")
})
s := standard.New("")
s.SetHandler(e)
http.Handle("/", s)
}
Run Code Online (Sandbox Code Playgroud)
这是错误和命令.
surface@DESKTOP-U7N4QNQ:~/projects$ goapp serve
INFO 2016-08-09 14:24:35,574 devappserver2.py:769] Skipping SDK update check.
INFO 2016-08-09 14:24:35,665 api_server.py:205] Starting API server at: http://localhost:38070
INFO 2016-08-09 14:24:35,670 api_server.py:648] Applying all pending transactions and saving the datastore …Run Code Online (Sandbox Code Playgroud) windows bash google-app-engine go windows-subsystem-for-linux