mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vweb: fix html example
This commit is contained in:
@ -1 +1,5 @@
|
||||
test <b>app</b>
|
||||
|
||||
<br>
|
||||
|
||||
<hr>
|
||||
|
@ -9,6 +9,7 @@ const (
|
||||
struct App {
|
||||
pub mut:
|
||||
vweb vweb.Context // TODO embed
|
||||
cnt int
|
||||
}
|
||||
|
||||
fn main() {
|
||||
@ -23,11 +24,11 @@ pub fn (app mut App) json_endpoint() {
|
||||
app.vweb.json('{"a": 3}')
|
||||
}
|
||||
|
||||
/*
|
||||
pub fn (app mut App) index() {
|
||||
$vweb.html()
|
||||
app.cnt ++
|
||||
|
||||
$vweb.html()
|
||||
}
|
||||
*/
|
||||
|
||||
pub fn (app mut App) text() {
|
||||
app.vweb.text('hello world')
|
||||
@ -38,4 +39,4 @@ pub fn (app mut App) cookie() {
|
||||
app.vweb.set_cookie('cookie', 'test')
|
||||
app.vweb.text(app.vweb.headers)
|
||||
app.vweb.text('Text: hello world')
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user