| 12345678910111213141516171819202122232425262728293031 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title></title>
- <meta charset="utf-8">
- </head>
- <body>
- <script type="text/sd-template" id="test">
- <p>{{hi}}!</p>
- </script>
- <script src="../dist/seed.js"></script>
- <script>
- var template = document.getElementById('test').innerHTML.trim()
- var china = new seed.ViewModel({
- template: template
- })
- document.body.appendChild(china.$el)
- china.hi = '你好'
- var Child = seed.ViewModel.extend({
- template: template
- })
- var hawaii = new Child()
- document.body.appendChild(hawaii.$el)
- hawaii.hi = 'Aloha!'
- </script>
- </body>
- </html>
|