Test:代码演示

Test:代码演示

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{% demo hexo-tag-demo %}
<intro>
An example for hexo-tag-demo.

The `<intro>` tag supports __markdown__.
</intro>

<template>
<div id="colorbox"></div>
<button id="demo-button">Click Me</button>
</template>

<script>
document.getElementById('demo-button').onclick = function() {
var randomColor = '#' + Math.random().toString().substr(2,6);
document.getElementById('colorbox').innerHTML = randomColor;
document.getElementById('colorbox').style.background = randomColor;
}
</script>

<style>
#colorbox {
border: 1px solid #ddd;
height: 150px;
width: 200px;
line-height: 150px;
text-align: center;
margin-bottom: 20px;
color: #fff;
}
#demo-button {
padding: 5px 10px;
}
</style>
{% enddemo %}
hexo-tag-demo

An example for hexo-tag-demo.

The <intro> tag supports markdown.

参考阅读#