O'Reilly logo

The Majesty of Vue.js by Kostas Maniatis, Alex Kyriakidis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Enhancing functionality

We should add a couple more features to make our list of stories neat. We can give the user the ability to change the plot and the writer of a story and create new stories.

Editing stories

Let's start with the first task and give the user some inputs to manipulate the story's attributes. Two bound inputs should do the job, but we should display them only when the user is editing a story. It seems like the kind of work we did in previous chapters.

To define if story is in edit state we will use a property, editing, which will become true when the user hits the Edit button:

<td>    <!--if editing story display the input for plot-->    <input v-if="story.editing" v-model="story.plot" class="form- control">    </input>    <!--in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required