expression.html 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title></title>
  5. <meta charset="utf-8">
  6. <script src="../../../dist/seed.js"></script>
  7. </head>
  8. <body>
  9. <div id="normal">
  10. <p sd-text="one + ' ' + two.three + '!'"></p>
  11. <input id="one" sd-model="one" name="one"> <input id="two" sd-model="two.three" name="two">
  12. <button sd-on="click: this.one = 'clicked'">click</button>
  13. </div>
  14. <div id="lazy">
  15. <p sd-text="one + ' ' + two.three + '!'"></p>
  16. <form id="form">
  17. <input sd-model="one" name="three"> <input sd-model="two.three" name="four">
  18. </form>
  19. <button sd-on="click: two.three = 'clicked'">click</button>
  20. </div>
  21. <script>
  22. var normal = new Seed({
  23. el: '#normal',
  24. scope: {
  25. one: 'Hello',
  26. two: {
  27. three: 'World'
  28. }
  29. }
  30. })
  31. var lazy = new Seed({
  32. el: '#lazy',
  33. lazy: true,
  34. scope: {
  35. one: 'Hi',
  36. two: {
  37. three: 'Ho'
  38. }
  39. }
  40. })
  41. </script>
  42. </body>
  43. </html>