| <!-- |
| * components |
| * data |
| * computed |
| * methods |
| * events |
| * init/created/ready |
| --> |
| |
| <template> |
| <div> |
| <text class="title">Please check out the source code.</text> |
| <!-- <sub></sub> --> |
| </div> |
| </template> |
| |
| <style> |
| .title {font-size: 48px;} |
| </style> |
| |
| <script> |
| // // import sub components |
| // require('./components/sub.vue') |
| module.exports = { |
| |
| // for root component only |
| data: { |
| x: 1, |
| y: 2 |
| }, |
| // // for sub component only |
| // data: function () { |
| // return { |
| // x: 1, |
| // y: 2 |
| // } |
| // } |
| |
| methods: { |
| foo: function () { |
| console.log('foo') |
| } |
| }, |
| |
| computed: { |
| z: function () { |
| return this.x + this.y |
| } |
| }, |
| |
| events: { |
| custom: function (e) { |
| console.log(e) |
| } |
| }, |
| |
| init: function () {}, |
| created: function () {}, |
| ready: function () {} |
| } |
| </script> |