Vue Javascript 学习


var app = new Vue({
  el: '#div1',
 data: {
  seen: true
 }
})


var app4 = new Vue({
  el: '#app-4',
  data: {
    todos: [
      { text: 'learn JavaScript' },
      { text: 'learn Vue' },
      { text: 'good project' }
    ]
  }
})

var  app5 = new Vue({
 el: '#app5',
 data: {
  message:'Come on, Test It.'
 },
 methods: {
  testClick : function() {
   alert(1)
  }
 }

});

var app6 = new Vue({
 el: '#app6',
 data: {
  message: ''
 },
 created: function() {
  console.log(" message is :" + this.message)
 }
});


var app7 = new Vue({
 el: "#app7",
 data: {
  rawHtml : "link"
 }
})

var app8 = new Vue({
 el: '#app8',
 data: {
  names: []
 }
})

var app9 = new Vue({
 el: '#app9',
 data: {
  country : 'USA'
 }
});

var app10 = new Vue({
 el: '#app10',
 created: function (){
  setInterval("app10.initTime()", 1000)
 },
 data : {
  hours: new Date().getHours(),
  minutes: new Date().getMinutes(),
  seconds: new Date().getSeconds()
 },
 methods: {
  initTime: function() {
   app10.hours = new Date().getHours(),
   app10.minutes = new Date().getMinutes(),
   app10.seconds = new Date().getSeconds()
  }
 }
})

评论