12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- //Component Object
- Component({
- options: {
- styleIsolation: 'isolated'
- },
- properties: {
- msg:{
- type:String,
- value:'',
- observer(a,b){
- console.log('msg changed: ', a, b);
- this.setData({
- name: Math.random()
- })
- }
- },
- },
- data: {
- name: 'Thanos'
- },
- methods: {
- log(){
- console.log('I am logger', this.properties.msg)
- this.triggerEvent('childEvent', new Date().getTime())
- },
- },
- observers:{
- name: function(a){
- console.log('name changed', a);
- }
- },
- created: function(){
- console.log('component created');
- },
- attached: function(){
- console.log('component attached');
- },
- ready: function(){
- console.log('component ready');
- },
- moved: function(){
- console.log('component moved');
- },
- detached: function(){
- console.log('component detached');
- },
- });
|