vue from rookie to master - 2

2018-09-19  本文已影响0人  ElliotG

1. Adding a CSS Framework

Adding Bootstrap to the Project

cd {project folder}
npm install bootstrap@4.0.0

**2. Adding Bootstrap in the main.js **

find in the src Folder

import "bootstrap/dist/css/bootstrap.min.css";

3. computed property

The computed property is used to define properties that operate on the application’s data, and this allows Vue.js to detect changes to the application data efficiently, which is important in complex applications.

export default {
    name: 'app',
    data() {
        ...
    },
    computed: {
        filteredTasks() {
            return this.hideCompleted ?
                this.tasks.filter(t => !t.done) : this.tasks
        }
    }
}
上一篇 下一篇

猜你喜欢

热点阅读