This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="app"> | |
<h2>Введите текст и нажмите enter</h2> | |
<ul> | |
<li v-for="message in messages">{{ message }}</li> | |
</ul> | |
<!-- Принимаем данные которые мы пробросили и создаем с ними метод --> | |
<message @message-saved="handleMessage"></message> | |
</div> | |
<script> | |
Vue.component('message', { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="app"> | |
<div id="app"> | |
<!-- <pre>{{$data}}</pre> --> | |
<div v-for="item in list"> | |
{{ item.username }} | |
<a :href="`mailto:${item.email}`">{{ item.email }}</a> | |
</div> | |
</div> | |
<!-- /#app --> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router-link.header-logo( to = "/" ) VUE-cli | |
router-link.navbar-link( :to = "`${link.url}`" ) {{ link.title }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Пока заголовок не заполнен, следующие действия не будут выполняться | |
if (this.taskTitle === "") { | |
return; | |
} | |
// Или сокращенная запись | |
if (!this.taskTitle) return; | |
// Пока заголовок не заполнен, следующие действия не будут выполняться |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template lang="pug"> | |
</template> | |
<script> | |
export default { | |
data() { | |
return {}; | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// +++++++++++++++++++++ 1.Create Task.vue +++++++++++++++++++++ | |
// --- template --- | |
<template lang="pug"> ... </template> | |
// --- script data --- | |
export default { | |
data() { | |
return { | |
tasks: [ | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Current functions | |
.push(tag.title); | |
.splice(tag.title, 1); | |
// All code | |
addTagUsed(tag) { | |
tag.use = !tag.use; | |
if (tag.use) { | |
this.tagsUsed.push(tag.title); | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default{ | |
state: {}, | |
mutations: {}, | |
actions: {}, | |
getters: {} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... // task.js | |
getters: { | |
tasks(state) { | |
return state.tasks; | |
} | |
} | |
... // Task.vue | |
computed: { | |
tasks() { |
OlderNewer