Skip to content

Commit 7861e04

Browse files
committed
完善无渲染组件的文档
1 parent 5076aba commit 7861e04

File tree

1 file changed

+29
-2
lines changed
  • docs/posts/tutorial

1 file changed

+29
-2
lines changed

docs/posts/tutorial/5.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
##### 组件一
66

7-
<p class="codepen" data-height="265" data-theme-id="0" data-default-tab="result" data-user="uncleze2017" data-slug-hash="EBgryO" style="height: 265px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;" data-pen-title="input-tag-list">
7+
<p class="codepen" data-height="320px" data-theme-id="0" data-default-tab="result" data-user="uncleze2017" data-slug-hash="EBgryO" style="height: 265px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;" data-pen-title="input-tag-list">
88
<span>See the Pen <a href="https://codepen.io/uncleze2017/pen/EBgryO/">
99
input-tag-list</a> by uncleze (<a href="https://codepen.io/uncleze2017">@uncleze2017</a>)
1010
on <a href="https://codepen.io">CodePen</a>.</span>
@@ -17,7 +17,7 @@
1717

1818
##### 组件二
1919

20-
<iframe height="265" style="width: 100%;" scrolling="no" title="input-tag" src="//codepen.io/uncleze2017/embed/xNQrZo/?height=265&theme-id=0&default-tab=result" frameborder="no" allowtransparency="true" allowfullscreen="true">
20+
<iframe height="320px" style="width: 100%;" scrolling="no" title="input-tag" src="//codepen.io/uncleze2017/embed/xNQrZo/?height=265&theme-id=0&default-tab=result" frameborder="no" allowtransparency="true" allowfullscreen="true">
2121
See the Pen <a href='https://codepen.io/uncleze2017/pen/xNQrZo/'>input-tag</a> by uncleze
2222
(<a href='https://codepen.io/uncleze2017'>@uncleze2017</a>) on <a href='https://codepen.io'>CodePen</a>.
2323
</iframe>
@@ -33,4 +33,31 @@
3333

3434
关于作用域插槽,我在之前的内容中有提到,Vue中的slot源于Web Components规范草案,也被称之为插槽。你可以认为插槽就是一个占位空壳子,插槽显示的内容由子组件自身决定,slot写在组件template的哪块,父组件传过来的模板将来就显示在哪块。
3535

36+
<iframe height="480px" style="width: 100%;" scrolling="no" title="message-box" src="//codepen.io/uncleze2017/embed/vqyEmV/?height=265&theme-id=0&default-tab=result" frameborder="no" allowtransparency="true" allowfullscreen="true">
37+
See the Pen <a href='https://codepen.io/uncleze2017/pen/vqyEmV/'>message-box</a> by uncleze
38+
(<a href='https://codepen.io/uncleze2017'>@uncleze2017</a>) on <a href='https://codepen.io'>CodePen</a>.
39+
</iframe>
40+
41+
```html
42+
<div id="app">
43+
<div class="box">
44+
<alert></alert>
45+
</div>
46+
<div class="box">
47+
<alert>这里消息盒子内容 !!!</alert>
48+
</div>
49+
<div class="box">
50+
<alert>
51+
<a href="https://www.baidu.com">https://www.baidu.com</a>
52+
</alert>
53+
</div>
54+
</div>
55+
56+
<script type="text/x-template" id="message">
57+
<div class="message" :class="messageClasses">
58+
<a class="close">&times;</a>
59+
<slot>This is message box!!!</slot>
60+
</div>
61+
</script>
62+
````
3663

0 commit comments

Comments
 (0)