Vue.js
[Vue.js] Vue.js templates
brightlightkim
2022. 5. 11. 04:15
v-html
- Expression
v-once
- Not Changable
- Not gonna update
v-bind
- ex: <img :class="'img-fluid" v-bind="products[0].image" :alt="products[0].name">
- : (Shortcut)
- :
- ex: <img :class ="imgClass + ' ' + 'w-25'">
- Make it to 25% of the size
v-bind="{
class: imgClass,
src : products[2].image,
alt : products[2].name
}
//You can make a class to bind multiple objects
computed properties:
- Caching >> Update >> So fast
data: {
slugText: "hello"
}
computed: {
slugetize: function () {
return this.slugText
.toLowerCase()
.replace(/[^\w ] )
}
}
Using Methods:
methods: {
now: function() {
//function...
}
}