<body>
<div id="app">
<h1>{{name.toUpperCase()}}</h1>
<!-- <h1>BLUE</h1> -->
</div>
</body>
<script>
let vm = new Vue({
el: "#app",
data: {
name: 'blue'
}
})
</script>
<body>
<div id="app">
<h1>{{rs}}</h1>
<!-- <h1>BLUE LOVE PINK</h1> -->
</div>
</body>
<script>
let vm = new Vue({
el: "#app",
data: {
hs: 'BLUE',
wf: "PINK"
},
computed: {
rs:function(){
return `${this.hs} LOVE ${this.wf}`
}
}
})
</script>
<body>
<div id="app">
<h1>{{hs}} LOVE {{wf}}</h1>
<!-- <h1>BLUE LOVE PINK</h1> -->
</div>
</body>
<script>
let vm = new Vue({
el: "#app",
data: {
hs: 'BLUE',
wf: "PINK"
}
})
</script>
<body>
<div id="app">
<h1>{{hs | lover}}</h1>
<!-- <h1>BLUE LOVE PINK</h1> -->
</div>
</body>
<script>
let vm = new Vue({
el: "#app",
data: {
hs: 'BLUE',
},
filters: {
lover(value){
return `${value} LOVE PINK`
}
}
})
</script>
<body>
<div id="app">
<h1>{{rs}}</h1>
<!-- <h1>EULB</h1> -->
</div>
</body>
<script>
let vm = new Vue({
el: "#app",
data: {
name: 'BLUE',
},
computed: {
rs: function () {
return [...this.name].reverse().join('');
}
}
})
</script>
<body>
<div id="app">
<h1>{{ rs() }}</h1>
<!-- <h1>EULB</h1> -->
</div>
</body>
<script>
let vm = new Vue({
el: "#app",
data: {
name: 'BLUE',
},
methods: {
rs() {
return [...this.name].reverse().join('');
}
}
})
</script>
<body>
<div id="app">
<h1>{{fullName}}</h1>
</div>
</body>
<script>
let vm = new Vue({
el: "#app",
data: {
firstName: 'Jack',
lastName: 'Blue',
fullName: 'Jack Blue'
},
watch: {
firstName: function (val) {
this.fullName = val + ' ' + this.lastName
},
lastName: function (val) {
this.fullName = this.firstName + ' ' + val
}
}
})
</script>
<body>
<div id="app">
<h1>{{fullName}}</h1>
<!-- <h1>Jack Blue</h1> -->
</div>
</body>
<script>
let vm = new Vue({
el: "#app",
data: {
firstName: 'Jack',
lastName: 'Blue',
},
computed: {
fullName() {
return this.firstName + ' ' + this.lastName
}
}
})
</script>
<body>
<div id="app">
<h1>{{fullName}}</h1>
<!-- <h1>Jack Blue</h1> -->
</div>
</body>
<script>
let vm = new Vue({
el: "#app",
data: {
firstName: 'Jack',
lastName: 'Blue',
},
computed: {
fullName: {
//getter
get() {
return this.firstName + ' ' + this.lastName
},
//setter
set(newValue) {
var names = newValue.split(' ')
this.firstName = names[0]
this.lastName = names[names.length - 1]
}
}
}
})
</script>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有