console
var app = new Vue({
el: '#app',
data: {
aoo: 'dadasad',
msg: 'abcdefg',
lists: ['aaa', 'bbb'],
isH: true
},
methods: {
changeThis: function () {
this.msg = this.msg.split('').reverse().join('')
}
}
})
Vue.component('cs', {
template: ' <h3>h3h3h3</h3>'
})
var app1 = new Vue({
el: '#app_1',
data: {
isA: false,
msg: 'hello'
},
methods: {
changeA: function () {
this.isA = !this.isA
}
},
computed: {
reverseMsg1: function () {
return this.msg.split('').reverse().join('')
},
reverseMsg: {
get: function () {
return this.msg.toUpperCase().concat(this.isA)
},
set: function () {
}
}
}
})
var app2 = new Vue({
el: '.app2',
data: {
styleObj: {
fontSize: '23px',
color: 'blue'
},
ok: true
}
})
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>
Document
</title>
<script src="http://cdn.staticfile.org/vue/2.5.17/vue.min.js">
</script>
</head>
<body>
<div class="app2">
<div :style="styleObj">1232132</div>
<template v-if="ok">
<h1 v-if="Math.random()>0.7">111</h1><h2>222</h2>
</template>
</div>
</body>
</html>
.a1{color: darkblue}
*{margin:0; padding:0;}